diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2018-04-04 04:33:54 +0300 |
---|---|---|
committer | Tatiana Yan <tatiana.kondakova@gmail.com> | 2018-04-05 12:12:34 +0300 |
commit | 98683edb44608033b41d0a1c4b381e7e134a2ffd (patch) | |
tree | b03671124d2ceebd48fba4fc6203cc665c914d9f | |
parent | ea9a592f1879d0b8a666c739c7a846548a1ece30 (diff) |
Review fixes.
-rw-r--r-- | base/base_tests/fifo_cache_test.cpp | 12 | ||||
-rw-r--r-- | base/fifo_cache.hpp | 2 | ||||
-rw-r--r-- | routing/geometry.hpp | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/base/base_tests/fifo_cache_test.cpp b/base/base_tests/fifo_cache_test.cpp index b80190ad46..f9fa25e8a6 100644 --- a/base/base_tests/fifo_cache_test.cpp +++ b/base/base_tests/fifo_cache_test.cpp @@ -23,10 +23,10 @@ public: bool IsValid() const { - std::set<Key> listKeys(m_cache.m_list.cbegin(), m_cache.m_list.cend()); - std::set<Key> mapKeys; + set<Key> listKeys(m_cache.m_list.cbegin(), m_cache.m_list.cend()); + set<Key> mapKeys; - for (auto const & kv :m_cache. m_map) + for (auto const & kv : m_cache.m_map) mapKeys.insert(kv.first); return listKeys == mapKeys; @@ -36,7 +36,7 @@ private: FifoCache<Key, Value> m_cache; }; -UNIT_TEST(FifoCacheSmokeTest) +UNIT_TEST(FifoCache_Smoke) { using Key = int; using Value = int; @@ -50,7 +50,7 @@ UNIT_TEST(FifoCacheSmokeTest) TEST(cache.IsValid(), ()); } -UNIT_TEST(FifoCacheTest) +UNIT_TEST(FifoCache) { using Key = int; using Value = int; @@ -77,7 +77,7 @@ UNIT_TEST(FifoCacheTest) } } -UNIT_TEST(FifoCacheLoaderCallsTest) +UNIT_TEST(FifoCache_LoaderCalls) { using Key = int; using Value = int; diff --git a/base/fifo_cache.hpp b/base/fifo_cache.hpp index da4665d57f..0eeb8dc4c4 100644 --- a/base/fifo_cache.hpp +++ b/base/fifo_cache.hpp @@ -34,7 +34,7 @@ public: auto & v = m_map[key]; m_loader(key, v); - return (m_map[key] = v); + return v; } private: diff --git a/routing/geometry.hpp b/routing/geometry.hpp index 62913c37b5..17c5ecae06 100644 --- a/routing/geometry.hpp +++ b/routing/geometry.hpp @@ -90,9 +90,9 @@ public: }; /// \brief This class supports loading geometry of roads for routing. -/// \note Loaded information about road geometry is kept in evicted cache |m_featureIdToRoad|. +/// \note Loaded information about road geometry is kept in a fixed-size cache |m_featureIdToRoad|. /// On the other hand methods GetRoad() and GetPoint() return geometry information by reference. -/// The reference is valid until the next call of GetRoad() or GetPoint() because the cache +/// The reference may be invalid after the next call of GetRoad() or GetPoint() because the cache /// item which is referred by returned reference may be evicted. It's done for performance reasons. class Geometry final { |