]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/hobject: make hobject_t::set_key avoid dups
authorSage Weil <sage@redhat.com>
Tue, 18 Aug 2015 18:25:38 +0000 (14:25 -0400)
committerSage Weil <sage@redhat.com>
Wed, 19 Aug 2015 21:03:57 +0000 (17:03 -0400)
If the key matches the oid name, clear it.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/hobject.h

index 321738ce7da991feff9f07932d2a7f205b754c24..0d74e21478ec3231261d054c8a0da674456ccb23 100644 (file)
@@ -60,7 +60,10 @@ public:
   }
 
   void set_key(const std::string &key_) {
-    key = key_;
+    if (key_ == oid.name)
+      key.clear();
+    else
+      key = key_;
   }
 
   string to_str() const;