Skip to content

Commit 70acd3f

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
remove folly hash from codebase (#41148)
Summary: Pull Request resolved: #41148 changelog: [internal] RN moved away from using folly::hash. These are a few places missed during the migration. Reviewed By: cipolleschi Differential Revision: D50540176 fbshipit-source-id: 497c13032c23c5b2dfab9e3d6f226f596b90761e
1 parent 2c90024 commit 70acd3f

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

packages/react-native/ReactCommon/react/renderer/attributedstring/TextAttributes.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <limits>
1212
#include <optional>
1313

14-
#include <folly/Hash.h>
1514
#include <react/renderer/attributedstring/primitives.h>
1615
#include <react/renderer/components/view/AccessibilityPrimitives.h>
1716
#include <react/renderer/core/LayoutPrimitives.h>
@@ -20,6 +19,7 @@
2019
#include <react/renderer/graphics/Color.h>
2120
#include <react/renderer/graphics/Float.h>
2221
#include <react/renderer/graphics/Size.h>
22+
#include <react/utils/hash_combine.h>
2323

2424
namespace facebook::react {
2525

@@ -108,8 +108,7 @@ template <>
108108
struct hash<facebook::react::TextAttributes> {
109109
size_t operator()(
110110
const facebook::react::TextAttributes& textAttributes) const {
111-
return folly::hash::hash_combine(
112-
0,
111+
return facebook::react::hash_combine(
113112
textAttributes.foregroundColor,
114113
textAttributes.backgroundColor,
115114
textAttributes.opacity,

packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include "RawPropsParser.h"
99

10-
#include <folly/Hash.h>
1110
#include <folly/Likely.h>
1211
#include <react/debug/react_native_assert.h>
1312
#include <react/renderer/core/RawProps.h>

packages/react-native/ReactCommon/react/renderer/core/RawPropsPrimitives.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#pragma once
99

10-
#include <folly/Hash.h>
1110
#include <limits>
1211

1312
namespace facebook::react {

packages/react-native/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ inline size_t textAttributedStringHashLayoutWise(
178178
auto seed = size_t{0};
179179

180180
for (const auto& fragment : attributedString.getFragments()) {
181-
seed =
182-
folly::hash::hash_combine(seed, textAttributesHashLayoutWise(fragment));
181+
facebook::react::hash_combine(seed, textAttributesHashLayoutWise(fragment));
183182
}
184183

185184
return seed;
@@ -208,8 +207,7 @@ namespace std {
208207
template <>
209208
struct hash<facebook::react::TextMeasureCacheKey> {
210209
size_t operator()(const facebook::react::TextMeasureCacheKey& key) const {
211-
return folly::hash::hash_combine(
212-
0,
210+
return facebook::react::hash_combine(
213211
textAttributedStringHashLayoutWise(key.attributedString),
214212
key.paragraphAttributes,
215213
key.layoutConstraints.maximumSize.width);

0 commit comments

Comments
 (0)