refs #545 Refactoring: extract method elementsStartingWith.

This commit is contained in:
Mathew Sutcliffe
2015-12-20 22:08:49 +00:00
parent 66fe290033
commit 757710797e
2 changed files with 19 additions and 2 deletions

View File

@@ -117,7 +117,7 @@ namespace BlackMisc
{
QMutexLocker lock(&m_mutex);
CVariantMap map;
for (const auto &element : makeRange(m_elements.lowerBound(keyPrefix), m_elements.lowerBound(keyPrefix + QChar(QChar::LastValidCodePoint))))
for (const auto &element : elementsStartingWith(keyPrefix))
{
implementationOf(map).insert(map.cend(), element->m_key, element->m_value);
}
@@ -128,7 +128,7 @@ namespace BlackMisc
{
QMutexLocker lock(&m_mutex);
CValueCachePacket map;
for (const auto &element : makeRange(m_elements.lowerBound(keyPrefix), m_elements.lowerBound(keyPrefix + QChar(QChar::LastValidCodePoint))))
for (const auto &element : elementsStartingWith(keyPrefix))
{
map.insert(element->m_key, element->m_value, element->m_timestamp);
}