MCPcopy Create free account
hub / github.com/comaps/comaps / IsKeyValidForTesting

Method IsKeyValidForTesting

libs/base/lru_cache.hpp:154–163  ·  view source on GitHub ↗

\returns true if |key| and its age are contained in |m_keyToAge| and |m_keyToAge|. \note It's a time consumption method and should be called for tests only.

Source from the content-addressed store, hash-verified

152 /// \returns true if |key| and its age are contained in |m_keyToAge| and |m_keyToAge|.
153 /// \note It's a time consumption method and should be called for tests only.
154 bool IsKeyValidForTesting(Key const & key) const
155 {
156 auto const keyToAgeId = m_keyToAge.find(key);
157 if (keyToAgeId == m_keyToAge.cend())
158 return false;
159 auto const ageToKeyIt = m_ageToKey.find(keyToAgeId->second);
160 if (ageToKeyIt == m_ageToKey.cend())
161 return false;
162 return key == ageToKeyIt->second;
163 }
164
165 private:
166 size_t m_age = 0;

Callers 1

IsValidForTestingMethod · 0.80

Calls 2

findMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected