aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2025-03-12 10:37:13 +0000
committerAlexander Smirnov <alex@ydb.tech>2025-03-12 10:37:13 +0000
commitb27c447af8bffc727382c0dc75272e261cbb4ac4 (patch)
treee0f6199fec84ae26bb5ea26566fa1daa12693e3b /library/cpp
parentcb56e1cde2824ff3b64be1de4794bff3cab0db61 (diff)
parentd06e9749bd6f0a561ee4fe296cdb3e03a24d1f82 (diff)
downloadydb-b27c447af8bffc727382c0dc75272e261cbb4ac4.tar.gz
Merge pull request #15611 from ydb-platform/merge-libs-250312-0708
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/containers/concurrent_hash/concurrent_hash.h16
-rw-r--r--library/cpp/tld/tlds-alpha-by-domain.txt2
2 files changed, 17 insertions, 1 deletions
diff --git a/library/cpp/containers/concurrent_hash/concurrent_hash.h b/library/cpp/containers/concurrent_hash/concurrent_hash.h
index 74573ecc09..6fed13ee8d 100644
--- a/library/cpp/containers/concurrent_hash/concurrent_hash.h
+++ b/library/cpp/containers/concurrent_hash/concurrent_hash.h
@@ -58,6 +58,16 @@ public:
return r;
}
+ bool TryRemoveUnsafe(const K& key, V& result) {
+ typename TActualMap::iterator it = Map.find(key);
+ if (it == Map.end()) {
+ return false;
+ }
+ result = std::move(it->second);
+ Map.erase(it);
+ return true;
+ }
+
bool HasUnsafe(const K& key) const {
typename TActualMap::const_iterator it = Map.find(key);
return (it != Map.end());
@@ -154,6 +164,12 @@ public:
return bucket.RemoveUnsafe(key);
}
+ bool TryRemove(const K& key, V& result) {
+ TBucket& bucket = GetBucketForKey(key);
+ TBucketGuard guard(bucket.Mutex);
+ return bucket.TryRemoveUnsafe(key, result);
+ }
+
bool Has(const K& key) const {
const TBucket& bucket = GetBucketForKey(key);
TBucketGuard guard(bucket.Mutex);
diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt
index 2355ccc90c..12b3e4c9af 100644
--- a/library/cpp/tld/tlds-alpha-by-domain.txt
+++ b/library/cpp/tld/tlds-alpha-by-domain.txt
@@ -1,4 +1,4 @@
-# Version 2025030700, Last Updated Fri Mar 7 07:07:01 2025 UTC
+# Version 2025031000, Last Updated Mon Mar 10 07:07:01 2025 UTC
AAA
AARP
ABB