From 967cabcaf2428e725fe4bca2c2669dcf2dc2a147 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Thu, 21 Sep 2017 12:10:42 +0200 Subject: [PATCH] mvcc: Make the null state of partition_snapshot::change_mark explicit --- partition_version.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/partition_version.hh b/partition_version.hh index 92ab4370a2..dae916e802 100644 --- a/partition_version.hh +++ b/partition_version.hh @@ -196,6 +196,8 @@ public: // References and iterators into versions owned by the snapshot // obtained between two equal change_mark objects were produced // by that snapshot are guaranteed to be still valid. + // + // Has a null state which is != than anything returned by get_change_mark(). class change_mark { uint64_t _reclaim_count = 0; size_t _versions_count = 0; // merge_partition_versions() removes versions on merge @@ -211,6 +213,9 @@ public: bool operator!=(const change_mark& m) const { return !(*this == m); } + explicit operator bool() const { + return _reclaim_count > 0; + } }; private: schema_ptr _schema;