From 97e09a301464ed08efeced2fe0119c3ac3fe1eb3 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sun, 31 Jul 2022 18:01:01 +0100 Subject: [PATCH] Fix latest commit not appearing on log --- src/database/schema/commit.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/database/schema/commit.rs b/src/database/schema/commit.rs index 3abecb0..0495360 100644 --- a/src/database/schema/commit.rs +++ a/src/database/schema/commit.rs @@ -142,13 +142,8 @@ }; let end = latest_key.saturating_sub(offset); - let start = end.saturating_sub(amount); - let range = start.to_be_bytes()..end.to_be_bytes(); - let iter = if range.is_empty() { - self.range(start.to_be_bytes()..=end.to_be_bytes()) - } else { - self.range(range) - }; + let start = end.saturating_sub(amount - 1); + let iter = self.range(start.to_be_bytes()..=end.to_be_bytes()); tokio::task::spawn_blocking(move || { iter.rev() -- rgit 0.1.3