summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-27 18:02:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-27 18:02:32 +0200
commit538c649f799c8c03218654588e6fd37162a151a1 (patch)
tree2db6626fe7bb69a588053591eb91018334c7ccab /include
parentc44d9f9e627eb074367cc47ae4742aedea44c370 (diff)
-Werror=shadow (GCC 8)
> include/o3tl/lru_map.hxx:70:24: error: declaration of ‘iterator’ shadows a previous local [-Werror=shadow] > map_iterator_t iterator = mLruMap.find(rPair.first); > ^~~~~~~~ > include/o3tl/lru_map.hxx:61:29: note: shadowed declaration is here > typedef list_iterator_t iterator; > ^~~~~~~~ Change-Id: Ic0f8ab4609a06b713ffa6e8e9fdd04f0c42869d7
Diffstat (limited to 'include')
-rw-r--r--include/o3tl/lru_map.hxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
index c1bfff733f5b..2f41521795fc 100644
--- a/include/o3tl/lru_map.hxx
+++ b/include/o3tl/lru_map.hxx
@@ -67,9 +67,9 @@ public:
void insert(key_value_pair_t& rPair)
{
- map_iterator_t iterator = mLruMap.find(rPair.first);
+ map_iterator_t i = mLruMap.find(rPair.first);
- if (iterator == mLruMap.end()) // doesn't exist -> add to queue and map
+ if (i == mLruMap.end()) // doesn't exist -> add to queue and map
{
// add to front of the list
mLruList.push_front(rPair);
@@ -80,17 +80,17 @@ public:
else // already exists -> replace value
{
// replace value
- iterator->second->second = rPair.second;
+ i->second->second = rPair.second;
// bring to front of the lru list
- mLruList.splice(mLruList.begin(), mLruList, iterator->second);
+ mLruList.splice(mLruList.begin(), mLruList, i->second);
}
}
void insert(key_value_pair_t&& rPair)
{
- map_iterator_t iterator = mLruMap.find(rPair.first);
+ map_iterator_t i = mLruMap.find(rPair.first);
- if (iterator == mLruMap.end()) // doesn't exist -> add to list and map
+ if (i == mLruMap.end()) // doesn't exist -> add to list and map
{
// add to front of the list
mLruList.push_front(std::move(rPair));
@@ -101,16 +101,16 @@ public:
else // already exists -> replace value
{
// replace value
- iterator->second->second = std::move(rPair.second);
+ i->second->second = std::move(rPair.second);
// push to back of the lru list
- mLruList.splice(mLruList.begin(), mLruList, iterator->second);
+ mLruList.splice(mLruList.begin(), mLruList, i->second);
}
}
const list_const_iterator_t find(const Key& key)
{
- const map_iterator_t iterator = mLruMap.find(key);
- if (iterator == mLruMap.cend()) // can't find entry for the key
+ const map_iterator_t i = mLruMap.find(key);
+ if (i == mLruMap.cend()) // can't find entry for the key
{
// return empty iterator
return mLruList.cend();
@@ -118,8 +118,8 @@ public:
else
{
// push to back of the lru list
- mLruList.splice(mLruList.begin(), mLruList, iterator->second);
- return iterator->second;
+ mLruList.splice(mLruList.begin(), mLruList, i->second);
+ return i->second;
}
}