Use empty() instead of '!size()' and "size() == 0" to check for emptiness
for performance reasons and since it's more logical.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Print some more results to fix issue found by cppcheck:
[src/scratchtoolpp.cc:111] -> [src/scratchtoolpp.cc:114]:
(performance) Variable 'r' is reassigned a value before
the old one has been used.
[src/scratchtoolpp.cc:207] -> [src/scratchtoolpp.cc:208]:
(performance) Variable 'r' is reassigned a value before
the old one has been used.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck:
[src/rgw/rgw_rest_swift.cc:770]: (performance) Passing the result of
c_str() to a function that takes std::string as argument no. 1 is
slow and redundant.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck:
[src/crush/CrushWrapper.cc:352]: (performance) Passing the result of
c_str() to a function that takes std::string as argument no. 4 is
slow and redundant.
[src/crush/CrushWrapper.cc:388]: (performance) Passing the result of
c_str() to a function that takes std::string as argument no. 4 is
slow and redundant.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck:
[src/rgw/rgw_log.cc:340]: (performance) Passing the result of c_str() to a
function that takes std::string as argument no. 4 is slow and redundant.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix issue found by cppcheck:
[src/rgw/rgw_admin.cc:710] -> [src/rgw/rgw_admin.cc:714]:
(performance) Variable 'ret' is reassigned a value before
the old one has been used.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Deal with this by moving the declaration to where we define
the value for a couple variables.
Signed-off-by: Greg Farnum <greg@inktank.com>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
This way the code is more logical.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
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 <danny.al-gaaf@bisect.de>
Fix it by declaring at the first real definition.
Signed-off-by: Greg Farnum <greg@inktank.com>
Fix handling of admin socket. The current script already use
$RUN_DIR to define a default, which is /var/run. Replace the
explicit path from get_conf call and replace it with $RUN_DIR.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Create pid and log dir only on start and not e.g. also on
stop. These calls are useless in other situtations than startup
the cluster or process.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
The ceph auth get-or-create example here is the only place on the
page that does not use 'allow <perms.' syntax. I found that
confusing. Update to use allow and single quotes.
Signed-off-by: Travis Rhoden <trhoden@gmail.com>
When specifying caps, the entire 'allow ...' bit needs to be in the
single quotes, including the pool= part.
Signed-off-by: Travis Rhoden <trhoden@gmail.com>
Remove librados2 requirement from librbd1. The RPM build system
will find the dependency by itself.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>