From: Ronen Friedman Date: Sun, 18 Feb 2024 11:53:50 +0000 (-0600) Subject: osd: use empty() instead of length() X-Git-Tag: v20.0.0~2558^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5e2f4e853679b23f17b3ba725549776e4d5861a5;p=ceph.git osd: use empty() instead of length() for std::string Signed-off-by: Ronen Friedman --- diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 8f08e298ee53..b95379ba8758 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -315,9 +315,9 @@ inline bool operator!=(const object_locator_t& l, const object_locator_t& r) { inline std::ostream& operator<<(std::ostream& out, const object_locator_t& loc) { out << "@" << loc.pool; - if (loc.nspace.length()) + if (!loc.nspace.empty()) out << ";" << loc.nspace; - if (loc.key.length()) + if (!loc.key.empty()) out << ":" << loc.key; return out; }