Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/core/json/json_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,10 @@ JSON::defines_any(std::initializer_list<JSON::String> keys) const -> bool {
return true;
}

static std::vector<std::uint64_t> cache;
cache.reserve(size);
// If we re-use the vector across threads, then we will segfault
thread_local std::vector<std::uint64_t> cache;
cache.clear();
cache.resize(size);

for (std::size_t index = 0; index < size; index++) {
cache[index] = items[index].fast_hash();
Expand Down