diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/containers/str_map | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/str_map')
-rw-r--r-- | library/cpp/containers/str_map/str_map.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/containers/str_map/str_map.h b/library/cpp/containers/str_map/str_map.h index 0be25902e6..31b00d1b99 100644 --- a/library/cpp/containers/str_map/str_map.h +++ b/library/cpp/containers/str_map/str_map.h @@ -35,12 +35,12 @@ pool_insert(Map* m, const char* key, const typename Map::mapped_type& data, TBuf #define AVERAGEWORD_BUF 10 template <class T, class HashFcn, class EqualTo, class Alloc> -class string_hash: public THashMap<const char*, T, HashFcn, EqualTo, Alloc> { +class string_hash: public THashMap<const char*, T, HashFcn, EqualTo, Alloc> { protected: TBuffer pool; public: - using yh = THashMap<const char*, T, HashFcn, EqualTo, Alloc>; + using yh = THashMap<const char*, T, HashFcn, EqualTo, Alloc>; using iterator = typename yh::iterator; using const_iterator = typename yh::const_iterator; using mapped_type = typename yh::mapped_type; @@ -50,7 +50,7 @@ public: pool.Reserve(HASH_SIZE_DEFAULT * AVERAGEWORD_BUF); // reserve here } string_hash(size_type hash_size, pool_size_type pool_size) - : THashMap<const char*, T, HashFcn, EqualTo, Alloc>(hash_size) + : THashMap<const char*, T, HashFcn, EqualTo, Alloc>(hash_size) { pool.Reserve(pool_size); // reserve here } @@ -68,14 +68,14 @@ public: } string_hash(const string_hash& sh) - : THashMap<const char*, T, HashFcn, EqualTo, Alloc>() + : THashMap<const char*, T, HashFcn, EqualTo, Alloc>() { for (const_iterator i = sh.begin(); i != sh.end(); ++i) insert_copy((*i).first, (*i).second); } /* May be faster? string_hash(const string_hash& sh) - : THashMap<const char *, T, HashFcn, EqualTo>(sh) + : THashMap<const char *, T, HashFcn, EqualTo>(sh) { pool = sh.pool; size_t delta = pool.begin() - sh.pool.begin(); @@ -101,12 +101,12 @@ public: }; template <class C, class T, class HashFcn, class EqualTo> -class THashWithSegmentedPoolForKeys: protected THashMap<const C*, T, HashFcn, EqualTo>, TNonCopyable { +class THashWithSegmentedPoolForKeys: protected THashMap<const C*, T, HashFcn, EqualTo>, TNonCopyable { protected: segmented_pool<C> pool; public: - using yh = THashMap<const C*, T, HashFcn, EqualTo>; + using yh = THashMap<const C*, T, HashFcn, EqualTo>; using iterator = typename yh::iterator; using const_iterator = typename yh::const_iterator; using mapped_type = typename yh::mapped_type; @@ -170,7 +170,7 @@ public: return yh::find(key); } - const yh& get_THashMap() const { + const yh& get_THashMap() const { return static_cast<const yh&>(*this); } }; |