From: Colin Patrick McCabe Date: Wed, 3 Nov 2010 19:15:20 +0000 (-0700) Subject: encoding.h: fix compiler warning X-Git-Tag: v0.23~46 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e586dd073cb0c7d68697b2a5883a580077a9093;p=ceph.git encoding.h: fix compiler warning Fix a compiler warning about an uninitialized variable. Basically, we used to insert uninitialized values into a std::multimap and then fix them later. Rather than doing that, just insert the value we want directly into the map. Signed-off-by: Colin McCabe --- diff --git a/src/include/encoding.h b/src/include/encoding.h index 0e3c55f7d296..1a08b21ace52 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -450,12 +450,10 @@ inline void decode(std::multimap& m, bufferlist::iterator& p) decode(n, p); m.clear(); while (n--) { - T k; - decode(k, p); - typename std::multimap::iterator it; - U u; - it = m.insert(std::pair(k, u)); - decode(it->second, p); + typename std::pair val; + decode(val.first, p); + decode(val.second, p); + m.insert(val); } }