Skip to content

Commit cbd818d

Browse files
cubuspl42facebook-github-bot
authored andcommitted
Clean up the function naming in TextMeasureCache.h (facebook#42598)
Summary: Clean up the function naming in `TextMeasureCache.h`. One name was clearly a human mistake. Make the naming consistent. This is a minor improvement in the context of my multi-PR work on react-native-community/discussions-and-proposals#695. ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [INTERNAL] [CHANGE] - Clean up the function naming in `TextMeasureCache.h` Pull Request resolved: facebook#42598 Reviewed By: NickGerleman Differential Revision: D52960435 Pulled By: sammy-SC fbshipit-source-id: 01327610446933972e8dc87e1b6e2950b7c706d2
1 parent ebb2b9c commit cbd818d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ inline bool areAttributedStringFragmentsEquivalentLayoutWise(
141141
rhs.parentShadowView.layoutMetrics));
142142
}
143143

144-
inline size_t textAttributesHashLayoutWise(
144+
inline size_t attributedStringFragmentHashLayoutWise(
145145
const AttributedString::Fragment& fragment) {
146146
// Here we are not taking `isAttachment` and `layoutMetrics` into account
147147
// because they are logically interdependent and this can break an invariant
@@ -171,12 +171,13 @@ inline bool areAttributedStringsEquivalentLayoutWise(
171171
return true;
172172
}
173173

174-
inline size_t textAttributedStringHashLayoutWise(
174+
inline size_t attributedStringHashLayoutWise(
175175
const AttributedString& attributedString) {
176176
auto seed = size_t{0};
177177

178178
for (const auto& fragment : attributedString.getFragments()) {
179-
facebook::react::hash_combine(seed, textAttributesHashLayoutWise(fragment));
179+
facebook::react::hash_combine(
180+
seed, attributedStringFragmentHashLayoutWise(fragment));
180181
}
181182

182183
return seed;
@@ -206,7 +207,7 @@ template <>
206207
struct hash<facebook::react::TextMeasureCacheKey> {
207208
size_t operator()(const facebook::react::TextMeasureCacheKey& key) const {
208209
return facebook::react::hash_combine(
209-
textAttributedStringHashLayoutWise(key.attributedString),
210+
attributedStringHashLayoutWise(key.attributedString),
210211
key.paragraphAttributes,
211212
key.layoutConstraints.maximumSize.width);
212213
}

0 commit comments

Comments
 (0)