From: Casey Bodley Date: Mon, 16 Mar 2020 15:58:00 +0000 (-0400) Subject: buffer: comparison operators take const bufferlist& X-Git-Tag: wip-pdonnell-testing-20200918.022351~1557^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f10d87318cc92c9255a8d794b9a634c8cd34b7d;p=ceph-ci.git buffer: comparison operators take const bufferlist& Signed-off-by: Casey Bodley --- diff --git a/src/include/buffer.h b/src/include/buffer.h index 5c8b427d030..c8310fefa5e 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -1230,7 +1230,7 @@ inline namespace v15_2_0 { } }; -inline bool operator>(bufferlist& l, bufferlist& r) { +inline bool operator>(const bufferlist& l, const bufferlist& r) { for (unsigned p = 0; ; p++) { if (l.length() > p && r.length() == p) return true; if (l.length() == p) return false; @@ -1238,7 +1238,7 @@ inline bool operator>(bufferlist& l, bufferlist& r) { if (l[p] < r[p]) return false; } } -inline bool operator>=(bufferlist& l, bufferlist& r) { +inline bool operator>=(const bufferlist& l, const bufferlist& r) { for (unsigned p = 0; ; p++) { if (l.length() > p && r.length() == p) return true; if (r.length() == p && l.length() == p) return true; @@ -1257,10 +1257,10 @@ inline bool operator==(const bufferlist &l, const bufferlist &r) { } return true; } -inline bool operator<(bufferlist& l, bufferlist& r) { +inline bool operator<(const bufferlist& l, const bufferlist& r) { return r > l; } -inline bool operator<=(bufferlist& l, bufferlist& r) { +inline bool operator<=(const bufferlist& l, const bufferlist& r) { return r >= l; }