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:
Samuel Susla
2023-10-23 20:30:55 -07:00
committed by Facebook GitHub Bot
parent 2c900242c1
commit 70acd3f7d9
4 changed files with 4 additions and 9 deletions
@@ -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 {
@@ -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);