From db175fb93802995f1625612818680e45d8650c9a Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Thu, 5 Mar 2015 06:47:57 +0100 Subject: [PATCH] rgw_rados: don't assign value to parameter Fix for cppcheck issue: Assignment of function parameter has no effect outside the function. Remove assignment to need_to_wait before exit. Signed-off-by: Danny Al-Gaaf --- src/rgw/rgw_rados.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index cb2ed4bd049de..2f7c7af1b30ba 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -975,6 +975,8 @@ int RGWPutObjProcessor_Aio::drain_pending() int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait) { + bool _wait = need_to_wait; + if (handle) { struct put_obj_aio_info info; info.handle = handle; @@ -988,7 +990,7 @@ int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait) if (r < 0) return r; - need_to_wait = false; + _wait = false; } /* resize window in case messages are draining too fast */ @@ -997,13 +999,10 @@ int RGWPutObjProcessor_Aio::throttle_data(void *handle, bool need_to_wait) } /* now throttle. Note that need_to_wait should only affect the first IO operation */ - if (pending.size() > max_chunks || - need_to_wait) { + if (pending.size() > max_chunks || _wait) { int r = wait_pending_front(); if (r < 0) return r; - - need_to_wait = false; } return 0; } -- 2.39.5