From 457790da6e21614fc80fc31bf3447e90095a15ac Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Tue, 16 Sep 2014 14:59:18 +0800 Subject: [PATCH] KeyValueStore: Reduce redundant "make_pair" Signed-off-by: Haomai Wang --- src/os/KeyValueStore.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/os/KeyValueStore.cc b/src/os/KeyValueStore.cc index af282d3fd1e..fdce0213c68 100644 --- a/src/os/KeyValueStore.cc +++ b/src/os/KeyValueStore.cc @@ -295,10 +295,11 @@ int KeyValueStore::BufferTransaction::lookup_cached_header( StripObjectMap::StripObjectHeaderRef *strip_header, bool create_if_missing) { + uniq_id uid = make_pair(cid, oid); StripObjectMap::StripObjectHeaderRef header; int r = 0; - StripHeaderMap::iterator it = strip_headers.find(make_pair(cid, oid)); + StripHeaderMap::iterator it = strip_headers.find(uid); if (it != strip_headers.end()) { if (!it->second->deleted) { @@ -325,9 +326,9 @@ int KeyValueStore::BufferTransaction::lookup_cached_header( return r; } - strip_headers[make_pair(cid, oid)] = header; + strip_headers[uid] = header; if (strip_header) - *strip_header = strip_headers[make_pair(cid, oid)]; + *strip_header = header; return r; } -- 2.47.3