mirror of
https://github.com/status-im/react-native.git
synced 2025-02-24 15:18:10 +00:00
Summary: Use a folly LRU implementation to cache results of ParagraphShadowNode::measure, which Yoga asks for repeatedly. Should have a substantial speed improvement on Android and iOS, or at least that's the dream. Reviewed By: mdvacca Differential Revision: D13795808 fbshipit-source-id: 5716af0fe0517a72716e48113c8125bb788735d7
19 lines
472 B
C++
19 lines
472 B
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
inline bool floatEquality (float a, float b, float epsilon = 0.005f) {
|
|
return (std::isnan(a) && std::isnan(b)) || (!std::isnan(a) && !std::isnan(b) && fabs(a - b) < epsilon);
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|