From c04dffbc01ddc0096862d208f462bfbeef37f47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Radwa=C5=84ski?= Date: Mon, 20 Sep 2021 14:03:08 +0200 Subject: [PATCH] partition_snapshot_reader: pop_range_tombstone returns reference (instead of value) when possible. --- partition_snapshot_reader.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/partition_snapshot_reader.hh b/partition_snapshot_reader.hh index 6eaab11e17..5763320e26 100644 --- a/partition_snapshot_reader.hh +++ b/partition_snapshot_reader.hh @@ -206,7 +206,10 @@ class partition_snapshot_flat_reader : public flat_mutation_reader::impl, public return !_clustering_rows.empty(); } - range_tombstone peek_range_tombstone() const { + // Let's not lose performance when not Reversing. + using peeked_range_tombstone = std::conditional_t; + + peeked_range_tombstone peek_range_tombstone() const { if constexpr (Reversing) { range_tombstone rt = std::prev(_range_tombstones.front().end())->tombstone(); rt.reverse();