]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use empty() instead of length()
authorRonen Friedman <rfriedma@redhat.com>
Sun, 18 Feb 2024 11:53:50 +0000 (05:53 -0600)
committerRonen Friedman <rfriedma@redhat.com>
Wed, 21 Feb 2024 14:07:06 +0000 (08:07 -0600)
for std::string

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/osd/osd_types.h

index 8f08e298ee530bd6bdc3fe3c9dde05b8567b6d32..b95379ba875824f401946c219ca30c91d7695be5 100644 (file)
@@ -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;
 }