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 | 1b7466cb957659079ebebbb5d76e64e51f3306f0 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/cache | |
parent | 23df4007b6ffbbdb0b25a214dded0c60538fb558 (diff) | |
download | ydb-1b7466cb957659079ebebbb5d76e64e51f3306f0.tar.gz |
Restoring authorship annotation for <wd28@yandex-team.ru>. Commit 2 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 baa39ec68f..71e1442717 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 fa7fa8a27b..329872cfde 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]); } } |