]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
memstore: use const_iterator instead of const_cast
authorCasey Bodley <cbodley@redhat.com>
Mon, 19 Sep 2016 14:57:42 +0000 (10:57 -0400)
committerCasey Bodley <cbodley@redhat.com>
Tue, 20 Sep 2016 19:40:49 +0000 (15:40 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/os/memstore/MemStore.cc

index d05e38687aec6e0d1114aafaf393196c155306e9..be708400ae4a84cf8f6ed3645bf030be2462ad82 100644 (file)
@@ -1652,8 +1652,7 @@ int MemStore::PageSetObject::write(uint64_t offset, const bufferlist &src)
 
   auto page = tls_pages.begin();
 
-  // XXX: cast away the const because bufferlist doesn't have a const_iterator
-  auto p = const_cast<bufferlist&>(src).begin();
+  auto p = src.begin();
   while (len > 0) {
     unsigned page_offset = offset - (*page)->offset;
     unsigned pageoff = data.get_page_size() - page_offset;