summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/encoding/ceph_dencoder.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/test/encoding/ceph_dencoder.cc b/src/test/encoding/ceph_dencoder.cc
index 3875aaae00e..c2bea68b266 100644
--- a/src/test/encoding/ceph_dencoder.cc
+++ b/src/test/encoding/ceph_dencoder.cc
@@ -142,9 +142,7 @@ public:
i = m_list.size();
if ((i == 0) || (i > m_list.size()))
return "invalid id for generated object";
- typename list<T*>::iterator p = m_list.begin();
- for (i--; i > 0 && p != m_list.end(); ++p, --i) ;
- m_object = *p;
+ m_object = *(std::next(m_list.begin(), i-1));
return string();
}
@@ -270,10 +268,8 @@ public:
i = m_list.size();
if ((i == 0) || (i > m_list.size()))
return "invalid id for generated object";
- typename list<T*>::iterator p = m_list.begin();
- for (i--; i > 0 && p != m_list.end(); ++p, --i) ;
m_object->put();
- m_object = *p;
+ m_object = *(std::next(m_list.begin(), i-1));
return string();
}
bool is_deterministic() override {