mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix hashing function in event name mapping in PerformanceEntryReporter (#36682)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36682 ## Changelog: [Internal][Fix] - Fix hashing function in event name mapping in PerformanceEntryReporter A textbook mistake, when mapping event names via the constant lookup table, only the first 8 characters were effectively taken into account, thus mixing names of some events. Reviewed By: rubennorte Differential Revision: D44462195 fbshipit-source-id: 273891d92251014661af731618d8a549627b2983
This commit is contained in:
committed by
Facebook GitHub Bot
parent
83056947aa
commit
9ccf85e240
@@ -273,10 +273,9 @@ void PerformanceEntryReporter::scheduleFlushBuffer() {
|
||||
|
||||
struct StrKey {
|
||||
uint32_t key;
|
||||
constexpr StrKey(const char *s)
|
||||
: key(folly::hash::fnv32_buf(s, sizeof(s) - 1)) {}
|
||||
StrKey(const char *s) : key(folly::hash::fnv32_buf(s, std::strlen(s))) {}
|
||||
|
||||
constexpr bool operator==(const StrKey &rhs) const {
|
||||
bool operator==(const StrKey &rhs) const {
|
||||
return key == rhs.key;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user