]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
object: pass const refs to comparators
authorSage Weil <sage@newdream.net>
Thu, 4 Jun 2009 17:49:45 +0000 (10:49 -0700)
committerSage Weil <sage@newdream.net>
Thu, 4 Jun 2009 17:49:45 +0000 (10:49 -0700)
src/include/object.h

index 0a3e432514359affcd2ee5f73806c3be7c00a53a..b072fa996200a3fba88a5105b431c7f5cf66e95a 100644 (file)
@@ -42,31 +42,31 @@ struct object_t {
 };
 WRITE_CLASS_ENCODER(object_t)
 
-inline bool operator==(const object_t l, const object_t r) {
+inline bool operator==(const object_t& l, const object_t& r) {
   return l.name == r.name;
 }
-inline bool operator!=(const object_t l, const object_t r) {
+inline bool operator!=(const object_t& l, const object_t& r) {
   return l.name != r.name;
 }
-inline bool operator>(const object_t l, const object_t r) {
+inline bool operator>(const object_t& l, const object_t& r) {
   return l.name > r.name;
 }
-inline bool operator<(const object_t l, const object_t r) {
+inline bool operator<(const object_t& l, const object_t& r) {
   return l.name < r.name;
 }
-inline bool operator>=(const object_t l, const object_t r) { 
+inline bool operator>=(const object_t& l, const object_t& r) { 
   return l.name >= r.name;
 }
-inline bool operator<=(const object_t l, const object_t r) {
+inline bool operator<=(const object_t& l, const object_t& r) {
   return l.name <= r.name;
 }
-inline ostream& operator<<(ostream& out, const object_t o) {
+inline ostream& operator<<(ostream& out, const object_t& o) {
   return out << o.name;
 }
 
 namespace __gnu_cxx {
   template<> struct hash<object_t> {
-    size_t operator()(const object_t &r) const { 
+    size_t operator()(const object_tr) const { 
       static hash<nstring> H;
       return H(r.name);
     }