]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
hobject_t: fix hobject(sobject_t) constructor
authorSage Weil <sage.weil@dreamhost.com>
Tue, 6 Dec 2011 23:38:00 +0000 (15:38 -0800)
committerSamuel Just <samuel.just@dreamhost.com>
Wed, 14 Dec 2011 19:32:21 +0000 (11:32 -0800)
Initialize max

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/include/object.h

index 3f99287f3736c731ac845a481ad7c2fbde95743f..0b13d61d4c43d7747634a34745989923a40bdf04 100644 (file)
@@ -279,6 +279,7 @@ public:
   }
   
   hobject_t() : snap(0), hash(0), max(false) {}
+
   hobject_t(object_t oid, const string& key, snapid_t snap, uint64_t hash) : 
     oid(oid), snap(snap), hash(hash), max(false),
     key(oid.name == key ? string() : key) {}
@@ -287,6 +288,12 @@ public:
     oid(soid.oid), snap(soid.snap), hash(hash), max(false),
     key(soid.oid.name == key ? string() : key) {}
 
+  /* Do not use when a particular hash function is needed */
+  explicit hobject_t(const sobject_t &o) :
+    oid(o.oid), snap(o.snap), max(false) {
+    hash = __gnu_cxx::hash<sobject_t>()(o);
+  }
+
   // maximum sorted value.
   static hobject_t get_max() {
     hobject_t h;
@@ -334,12 +341,6 @@ public:
     snap = 0;
   }
 
-  /* Do not use when a particular hash function is needed */
-  explicit hobject_t(const sobject_t &o) :
-    oid(o.oid), snap(o.snap) {
-    hash = __gnu_cxx::hash<sobject_t>()(o);
-  }
-
   void swap(hobject_t &o) {
     hobject_t temp(o);
     o.oid = oid;