]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/buffer: use range-based loop 14853/head
authorSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 14:13:46 +0000 (10:13 -0400)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 14:13:46 +0000 (10:13 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/include/buffer.h

index 3a93091b83a7b18700a8eda849678c16a01bdaea..4c807a00995972f46931d444ea3bb75cee8d17d6 100644 (file)
@@ -873,11 +873,10 @@ namespace buffer CEPH_BUFFER_API {
       assert(_buffers.size() <= IOV_MAX);
       piov->resize(_buffers.size());
       unsigned n = 0;
-      for (std::list<buffer::ptr>::const_iterator p = _buffers.begin();
-          p != _buffers.end();
-          ++p, ++n) {
-       (*piov)[n].iov_base = (void *)p->c_str();
-       (*piov)[n].iov_len = p->length();
+      for (auto& p : _buffers) {
+       (*piov)[n].iov_base = (void *)p.c_str();
+       (*piov)[n].iov_len = p.length();
+       ++n;
       }
     }
     uint32_t crc32c(uint32_t crc) const;