mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
remove use of folly::hash from attributedstring module (#39512)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39512 changelog: [internal] Reviewed By: cipolleschi Differential Revision: D49349658 fbshipit-source-id: 2b1e3ce2051e995fe5a29a8021c221c69df28ce2
This commit is contained in:
committed by
Facebook GitHub Bot
parent
bf186471d3
commit
43eb18b1ae
+3
-5
@@ -7,15 +7,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include <folly/Hash.h>
|
||||
#include <react/renderer/attributedstring/TextAttributes.h>
|
||||
#include <react/renderer/core/Sealable.h>
|
||||
#include <react/renderer/core/ShadowNode.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/mounting/ShadowView.h>
|
||||
#include <react/utils/hash_combine.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -123,8 +122,7 @@ template <>
|
||||
struct hash<facebook::react::AttributedString::Fragment> {
|
||||
size_t operator()(
|
||||
const facebook::react::AttributedString::Fragment& fragment) const {
|
||||
return folly::hash::hash_combine(
|
||||
0,
|
||||
return facebook::react::hash_combine(
|
||||
fragment.string,
|
||||
fragment.textAttributes,
|
||||
fragment.parentShadowView,
|
||||
@@ -139,7 +137,7 @@ struct hash<facebook::react::AttributedString> {
|
||||
auto seed = size_t{0};
|
||||
|
||||
for (const auto& fragment : attributedString.getFragments()) {
|
||||
seed = folly::hash::hash_combine(seed, fragment);
|
||||
facebook::react::hash_combine(seed, fragment);
|
||||
}
|
||||
|
||||
return seed;
|
||||
|
||||
+2
-3
@@ -9,10 +9,10 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <folly/Hash.h>
|
||||
#include <react/renderer/attributedstring/primitives.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Float.h>
|
||||
#include <react/utils/hash_combine.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -88,8 +88,7 @@ template <>
|
||||
struct hash<facebook::react::ParagraphAttributes> {
|
||||
size_t operator()(
|
||||
const facebook::react::ParagraphAttributes& attributes) const {
|
||||
return folly::hash::hash_combine(
|
||||
0,
|
||||
return facebook::react::hash_combine(
|
||||
attributes.maximumNumberOfLines,
|
||||
attributes.ellipsizeMode,
|
||||
attributes.textBreakStrategy,
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
|
||||
#include "ParagraphLayoutManager.h"
|
||||
#include <folly/Hash.h>
|
||||
#include <react/utils/CoreFeatures.h>
|
||||
#include <react/utils/hash_combine.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -43,7 +43,7 @@ bool ParagraphLayoutManager::shoudMeasureString(
|
||||
const ParagraphAttributes& paragraphAttributes,
|
||||
LayoutConstraints layoutConstraints) const {
|
||||
size_t newParagraphInputHash =
|
||||
folly::hash::hash_combine(0, attributedString, paragraphAttributes);
|
||||
hash_combine(attributedString, paragraphAttributes);
|
||||
|
||||
if (newParagraphInputHash != paragraphInputHash_) {
|
||||
// AttributedString or ParagraphAttributes have changed.
|
||||
|
||||
Reference in New Issue
Block a user