]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/encoding: add decode_noclear() variant for map<> decode with comparator
authorSage Weil <sage@redhat.com>
Fri, 24 Jul 2015 15:11:21 +0000 (11:11 -0400)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 14:16:05 +0000 (10:16 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/include/encoding.h

index a4b5d03d33e3fb53a6ea6b08f99aaa7e668a6ec9..b137f329b74b05fd9100566eba97f59c01677258 100644 (file)
@@ -676,6 +676,17 @@ inline void decode(std::map<T,U,C>& m, bufferlist::iterator& p)
     decode(m[k], p);
   }
 }
+template<class T, class U, class C>
+inline void decode_noclear(std::map<T,U,C>& m, bufferlist::iterator& p)
+{
+  __u32 n;
+  decode(n, p);
+  while (n--) {
+    T k;
+    decode(k, p);
+    decode(m[k], p);
+  }
+}
 template<class T, class U>
 inline void decode_noclear(std::map<T,U>& m, bufferlist::iterator& p)
 {