diff --git a/packages/react-native/ReactCommon/react/performance/timeline/BoundedConsumableBuffer.h b/packages/react-native/ReactCommon/react/performance/timeline/BoundedConsumableBuffer.h index b1174ea0e3c1f9..31800e1ff039b8 100644 --- a/packages/react-native/ReactCommon/react/performance/timeline/BoundedConsumableBuffer.h +++ b/packages/react-native/ReactCommon/react/performance/timeline/BoundedConsumableBuffer.h @@ -13,7 +13,7 @@ namespace facebook::react { -constexpr int DEFAULT_MAX_SIZE = 1024; +constexpr size_t DEFAULT_MAX_SIZE = 1024; /** * A container for storing entries of type T, with the following properties: @@ -47,7 +47,7 @@ class BoundedConsumableBuffer { DROP = 2, }; - BoundedConsumableBuffer(int maxSize = DEFAULT_MAX_SIZE) : maxSize_(maxSize) { + BoundedConsumableBuffer(size_t maxSize = DEFAULT_MAX_SIZE) : maxSize_(maxSize) { entries_.reserve(maxSize_); } @@ -229,18 +229,18 @@ class BoundedConsumableBuffer { private: std::vector entries_; - const int maxSize_; + const size_t maxSize_; // Current starting position in the circular buffer: - int position_{0}; + size_t position_{0}; - // Current "cursor" - positions of the firsst and after last unconsumed + // Current "cursor" - positions of the first and after last unconsumed // element, relative to the starting position: - int cursorStart_{0}; - int cursorEnd_{0}; + size_t cursorStart_{0}; + size_t cursorEnd_{0}; // Number of currently unconsumed elements: - int numToConsume_{0}; + size_t numToConsume_{0}; }; } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/observers/events/EventPerformanceLogger.cpp b/packages/react-native/ReactCommon/react/renderer/observers/events/EventPerformanceLogger.cpp index 73cf365de4150c..95e66d16445c02 100644 --- a/packages/react-native/ReactCommon/react/renderer/observers/events/EventPerformanceLogger.cpp +++ b/packages/react-native/ReactCommon/react/renderer/observers/events/EventPerformanceLogger.cpp @@ -15,7 +15,7 @@ namespace facebook::react { namespace { struct StrKey { - uint32_t key; + size_t key; StrKey(std::string_view s) : key(std::hash{}(s)) {} bool operator==(const StrKey& rhs) const { @@ -25,7 +25,7 @@ struct StrKey { struct StrKeyHash { constexpr size_t operator()(const StrKey& strKey) const { - return static_cast(strKey.key); + return strKey.key; } };