From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 14:30:19 +0000 (+0100) Subject: Objecter.cc: prevent useless value assignment X-Git-Tag: v0.58~66^2~41 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb6561e74245fd7ecc58898c68ce3a52129974bf;p=ceph.git Objecter.cc: prevent useless value assignment Fix issue found by cppcheck: [src/osdc/Objecter.cc:989] -> [src/osdc/Objecter.cc:992]: (performance) Variable 'check_for_latest_map' is reassigned a value before the old one has been used. Signed-off-by: Danny Al-Gaaf Fix it by declaring at the first real definition. Signed-off-by: Greg Farnum --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 7b45dcdb2004..21d9df7f3d69 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -986,10 +986,9 @@ tid_t Objecter::_op_submit(Op *op) assert(client_inc >= 0); // pick target - bool check_for_latest_map = false; num_homeless_ops++; // initially; recalc_op_target() will decrement if it finds a target int r = recalc_op_target(op); - check_for_latest_map = (r == RECALC_OP_TARGET_POOL_DNE); + bool check_for_latest_map = (r == RECALC_OP_TARGET_POOL_DNE); // add to gather set(s) if (op->onack) {