mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
remove folly hash from codebase (#41148)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2c900242c1
commit
70acd3f7d9
@@ -11,7 +11,6 @@
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
|
||||
#include <folly/Hash.h>
|
||||
#include <react/renderer/attributedstring/primitives.h>
|
||||
#include <react/renderer/components/view/AccessibilityPrimitives.h>
|
||||
#include <react/renderer/core/LayoutPrimitives.h>
|
||||
@@ -20,6 +19,7 @@
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Float.h>
|
||||
#include <react/renderer/graphics/Size.h>
|
||||
#include <react/utils/hash_combine.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -108,8 +108,7 @@ template <>
|
||||
struct hash<facebook::react::TextAttributes> {
|
||||
size_t operator()(
|
||||
const facebook::react::TextAttributes& textAttributes) const {
|
||||
return folly::hash::hash_combine(
|
||||
0,
|
||||
return facebook::react::hash_combine(
|
||||
textAttributes.foregroundColor,
|
||||
textAttributes.backgroundColor,
|
||||
textAttributes.opacity,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "RawPropsParser.h"
|
||||
|
||||
#include <folly/Hash.h>
|
||||
#include <folly/Likely.h>
|
||||
#include <react/debug/react_native_assert.h>
|
||||
#include <react/renderer/core/RawProps.h>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <folly/Hash.h>
|
||||
#include <limits>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
+2
-4
@@ -178,8 +178,7 @@ inline size_t textAttributedStringHashLayoutWise(
|
||||
auto seed = size_t{0};
|
||||
|
||||
for (const auto& fragment : attributedString.getFragments()) {
|
||||
seed =
|
||||
folly::hash::hash_combine(seed, textAttributesHashLayoutWise(fragment));
|
||||
facebook::react::hash_combine(seed, textAttributesHashLayoutWise(fragment));
|
||||
}
|
||||
|
||||
return seed;
|
||||
@@ -208,8 +207,7 @@ namespace std {
|
||||
template <>
|
||||
struct hash<facebook::react::TextMeasureCacheKey> {
|
||||
size_t operator()(const facebook::react::TextMeasureCacheKey& key) const {
|
||||
return folly::hash::hash_combine(
|
||||
0,
|
||||
return facebook::react::hash_combine(
|
||||
textAttributedStringHashLayoutWise(key.attributedString),
|
||||
key.paragraphAttributes,
|
||||
key.layoutConstraints.maximumSize.width);
|
||||
|
||||
Reference in New Issue
Block a user