aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2025-03-12 07:09:44 +0000
committerAlexander Smirnov <alex@ydb.tech>2025-03-12 07:09:44 +0000
commitf31f6ec483fc78a200aef65cf08ee98e8a6a7cea (patch)
tree7428e41dea304eeda9d97ded266d42995478a0b4 /library/cpp
parent9059c4534bd1b0fb20ba2426eb59640415e24113 (diff)
parent7ae87080b7fdfadae6ebb86360ba3eb4c6325e2d (diff)
downloadydb-f31f6ec483fc78a200aef65cf08ee98e8a6a7cea.tar.gz
Merge branch 'rightlib' into 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