From 4e586dd073cb0c7d68697b2a5883a580077a9093 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Wed, 3 Nov 2010 12:15:20 -0700 Subject: [PATCH] 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 --- src/include/encoding.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/include/encoding.h b/src/include/encoding.h index 0e3c55f7d296d..1a08b21ace526 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); } } -- 2.39.5