From 1e156feb9a0ab7efa05d966ce5c5a3c58c9224af Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Fri, 23 Dec 2016 16:56:33 +0800 Subject: [PATCH] os/bluestore: remove intermediate key var to avoid string copy Signed-off-by: xie xingguo --- src/os/bluestore/BlueStore.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index a4acb10b0f82d..6c94e3af91caf 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4608,9 +4608,8 @@ int BlueStore::fsck(bool deep) it = db->get_iterator(PREFIX_OMAP); if (it) { for (it->lower_bound(string()); it->valid(); it->next()) { - string key = it->key(); uint64_t omap_head; - _key_decode_u64(key.c_str(), &omap_head); + _key_decode_u64(it->key().c_str(), &omap_head); if (used_omap_head.count(omap_head) == 0) { derr << __func__ << " found stray omap data on omap_head " << omap_head << dendl; -- 2.39.5