From 492553b3c62a05dfee2a79f1ad8cb29104de0e5f Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 15 May 2013 14:56:27 +0200 Subject: [PATCH] rgw/rgw_common.cc: reduce scope of 'end' in two cases Signed-off-by: Danny Al-Gaaf --- src/rgw/rgw_common.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index 5a9bf3d274710..1e37d9bac91f4 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -734,9 +734,8 @@ int RGWUserCaps::remove_cap(const string& cap) int RGWUserCaps::add_from_string(const string& str) { int start = 0; - int end; do { - end = str.find(';', start); + int end = str.find(';', start); if (end < 0) end = str.size(); @@ -753,9 +752,8 @@ int RGWUserCaps::add_from_string(const string& str) int RGWUserCaps::remove_from_string(const string& str) { int start = 0; - int end; do { - end = str.find(';', start); + int end = str.find(';', start); if (end < 0) end = str.size(); -- 2.39.5