Skip to content

Commit

Permalink
Clean up the function naming in TextMeasureCache.h
Browse files Browse the repository at this point in the history
One name was clearly a human mistake. Make the naming consistent.
  • Loading branch information
cubuspl42 committed Jan 22, 2024
1 parent 96ed119 commit e6a0bf8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ inline bool areAttributedStringFragmentsEquivalentLayoutWise(
rhs.parentShadowView.layoutMetrics));
}

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

inline size_t textAttributedStringHashLayoutWise(
inline size_t attributedStringHashLayoutWise(
const AttributedString& attributedString) {
auto seed = size_t{0};

for (const auto& fragment : attributedString.getFragments()) {
facebook::react::hash_combine(seed, textAttributesHashLayoutWise(fragment));
facebook::react::hash_combine(seed, attributedStringFragmentHashLayoutWise(fragment));
}

return seed;
Expand Down Expand Up @@ -206,7 +206,7 @@ template <>
struct hash<facebook::react::TextMeasureCacheKey> {
size_t operator()(const facebook::react::TextMeasureCacheKey& key) const {
return facebook::react::hash_combine(
textAttributedStringHashLayoutWise(key.attributedString),
attributedStringHashLayoutWise(key.attributedString),
key.paragraphAttributes,
key.layoutConstraints.maximumSize.width);
}
Expand Down

0 comments on commit e6a0bf8

Please sign in to comment.