diff options
author | wd28 <wd28@yandex-team.ru> | 2022-02-10 16:49:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:40 +0300 |
commit | 23df4007b6ffbbdb0b25a214dded0c60538fb558 (patch) | |
tree | 552b6899d1abd354ee256351af6e698ac3b86227 /library/cpp/cache | |
parent | 5c6482e8c13dfaad60e604f0474606a0ec153b1d (diff) | |
download | ydb-23df4007b6ffbbdb0b25a214dded0c60538fb558.tar.gz |
Restoring authorship annotation for <wd28@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/cache')
-rw-r--r-- | library/cpp/cache/thread_safe_cache.h | 14 | ||||
-rw-r--r-- | library/cpp/cache/ut/cache_ut.cpp | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/cache/thread_safe_cache.h b/library/cpp/cache/thread_safe_cache.h index 71e1442717..baa39ec68f 100644 --- a/library/cpp/cache/thread_safe_cache.h +++ b/library/cpp/cache/thread_safe_cache.h @@ -15,8 +15,8 @@ namespace NPrivate { template <class Key, class Value, template <class, class> class List, EGettersPromotionPolicy GettersPromotionPolicy, class... TArgs> class TThreadSafeCache { public: - using TPtr = TAtomicSharedPtr<Value>; - + using TPtr = TAtomicSharedPtr<Value>; + class ICallbacks { public: using TKey = Key; @@ -30,9 +30,9 @@ namespace NPrivate { }; public: - TThreadSafeCache(const ICallbacks& callbacks, size_t maxSize = Max<size_t>()) + TThreadSafeCache(const ICallbacks& callbacks, size_t maxSize = Max<size_t>()) : Callbacks(callbacks) - , Cache(maxSize) + , Cache(maxSize) { } @@ -49,7 +49,7 @@ namespace NPrivate { Cache.Update(key, value); } - const TPtr Get(TArgs... args) const { + const TPtr Get(TArgs... args) const { return GetValue<true>(args...); } @@ -82,7 +82,7 @@ namespace NPrivate { } template <class TCallbacks> - static const TPtr Get(TArgs... args) { + static const TPtr Get(TArgs... args) { return TThreadSafeCacheSingleton<TCallbacks>::Get(args...); } @@ -140,7 +140,7 @@ namespace NPrivate { template <class TCallbacks> class TThreadSafeCacheSingleton { public: - static const TPtr Get(TArgs... args) { + static const TPtr Get(TArgs... args) { return Singleton<TThreadSafeCacheSingleton>()->Cache.Get(args...); } diff --git a/library/cpp/cache/ut/cache_ut.cpp b/library/cpp/cache/ut/cache_ut.cpp index 329872cfde..fa7fa8a27b 100644 --- a/library/cpp/cache/ut/cache_ut.cpp +++ b/library/cpp/cache/ut/cache_ut.cpp @@ -377,8 +377,8 @@ Y_UNIT_TEST_SUITE(TThreadSafeCacheTest) { Y_UNIT_TEST(SimpleTest) { for (ui32 i = 0; i < Y_ARRAY_SIZE(VALS); ++i) { - const TString data = *TCache::Get<TCallbacks>(i); - UNIT_ASSERT(data == VALS[i]); + const TString data = *TCache::Get<TCallbacks>(i); + UNIT_ASSERT(data == VALS[i]); } } |