From dc1750a9a284b1a884d73880cff76279607dc63d Mon Sep 17 00:00:00 2001 From: PerfAICT Bot Date: Fri, 17 Apr 2026 15:25:54 -0700 Subject: [PATCH] fbcode/cachelib/allocator/nvmcache/TombStones.h Reviewed By: MatzeB Differential Revision: D101369846 --- cachelib/allocator/nvmcache/TombStones.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cachelib/allocator/nvmcache/TombStones.h b/cachelib/allocator/nvmcache/TombStones.h index 9c5c275b5f..b3d8404c7b 100644 --- a/cachelib/allocator/nvmcache/TombStones.h +++ b/cachelib/allocator/nvmcache/TombStones.h @@ -42,12 +42,7 @@ class alignas(folly::hardware_destructive_interference_size) TombStones { // @return a valid Guard representing the tombstone Guard add(folly::StringPiece key) { std::lock_guard l(mutex_); - auto it = keys_.find(key); - - if (it == keys_.end()) { - it = keys_.insert(std::make_pair(key.toString(), 0)).first; - } - + auto [it, inserted] = keys_.try_emplace(key, 0); ++it->second; return Guard(it->first, *this); }