From: yang.wang Date: Mon, 4 Sep 2017 12:20:11 +0000 (+0800) Subject: osd_types: define max in eversion_t::max() to static X-Git-Tag: v13.0.1~965^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=80ee9c2a2b209c373626cb7bd4bd6e887026d8b3;p=ceph.git osd_types: define max in eversion_t::max() to static max in eversion_t::max() can be static, no need to re constructs it every time when calling eversion_t::max(), and max can be constructed using eversion_t(epoch_t e, version_t v), it better than firstly construct it by eversion_t() and then reassign it to (-1,-1) Change-Id: I85de5685024e61ebc2d1816b0969be67bdaf45f5 Signed-off-by: yang.wang yang.wang@easystack.cn --- diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 8934910566f85..6de4d40d714bc 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -795,10 +795,8 @@ public: explicit eversion_t(bufferlist& bl) : __pad(0) { decode(bl); } - static eversion_t max() { - eversion_t max; - max.version -= 1; - max.epoch -= 1; + static const eversion_t& max() { + static const eversion_t max(-1,-1); return max; }