From: Yingxin Cheng Date: Wed, 16 Dec 2020 08:00:26 +0000 (+0800) Subject: crimson/onode-staged-tree: remove the unnecessary end_index X-Git-Tag: v16.1.0~63^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c4f6ba016f359949d2e67a51d6bc4b31607eda7c;p=ceph.git crimson/onode-staged-tree: remove the unnecessary end_index Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h index 8dec00c8add..269999f06ed 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h @@ -492,7 +492,7 @@ struct staged { index_t index() const { if (is_end()) { - return end_index; + return container.index() + 1; } else { return container.index(); } @@ -513,7 +513,14 @@ struct staged { assert(!is_end()); return !container.has_next(); } - bool is_end() const { return _is_end; } + bool is_end() const { +#ifndef NDEBUG + if (_is_end) { + assert(!container.has_next()); + } +#endif + return _is_end; + } node_offset_t size() const { assert(!is_end()); return container.size(); @@ -562,7 +569,6 @@ struct staged { assert(!is_end()); assert(is_last()); _is_end = true; - end_index = container.index() + 1; } // Note: possible to return an end iterator MatchKindBS seek(const full_key_t& key, bool exclude_last) { @@ -749,7 +755,6 @@ struct staged { private: container_t container; bool _is_end = false; - index_t end_index; }; /*