From b0fff52a4f486d16d9edeb363ab49ae9f3ac7f84 Mon Sep 17 00:00:00 2001 From: Anthony Astolfi Date: Tue, 28 May 2024 10:56:01 -0400 Subject: [PATCH] CR feedback. --- src/llfs/basic_log_storage_reader.hpp | 7 ++----- src/llfs/slot.hpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/llfs/basic_log_storage_reader.hpp b/src/llfs/basic_log_storage_reader.hpp index ae829a9..2c7210d 100644 --- a/src/llfs/basic_log_storage_reader.hpp +++ b/src/llfs/basic_log_storage_reader.hpp @@ -147,11 +147,8 @@ class BasicLogStorageReader : public LogDevice::Reader void refresh_view(slot_offset_type upper_bound) { - this->data_ = [&] { - ConstBuffer b = this->context_.buffer_.get(this->offset_); - - return ConstBuffer{b.data(), slot_clamp_distance(this->offset_, upper_bound)}; - }(); + const ConstBuffer b = this->context_.buffer_.get(this->offset_); + this->data_ = ConstBuffer{b.data(), slot_clamp_distance(this->offset_, upper_bound)}; } //==#==========+==+=+=++=+++++++++++-+-+--+----- --- -- - - - - diff --git a/src/llfs/slot.hpp b/src/llfs/slot.hpp index 10b2599..cadc39e 100644 --- a/src/llfs/slot.hpp +++ b/src/llfs/slot.hpp @@ -124,7 +124,7 @@ inline isize slot_difference(slot_offset_type x, slot_offset_type y) inline usize slot_abs_distance(slot_offset_type x, slot_offset_type y) { if (slot_less_than(y, x)) { - return slot_abs_distance(y, x); + return x - y; } return y - x; }