aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-17 11:50:23 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-17 11:50:23 +0200
commitc692f55d5ce2c3ed08db7fbc4844debcc0aeb134 (patch)
tree920712b4ccfa111f01c16e3314a872201ab04ccf /src/api
parent7b474855e3a8491fcdde69d12d3fbae27f520383 (diff)
downloadgarage-c692f55d5ce2c3ed08db7fbc4844debcc0aeb134.tar.gz
garage-c692f55d5ce2c3ed08db7fbc4844debcc0aeb134.zip
K2V: Fix `end` parameter and add tests (fix #305)fix-k2v-305
Diffstat (limited to 'src/api')
-rw-r--r--src/api/k2v/range.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/api/k2v/range.rs b/src/api/k2v/range.rs
index cd019723..295c34aa 100644
--- a/src/api/k2v/range.rs
+++ b/src/api/k2v/range.rs
@@ -74,7 +74,11 @@ where
}
}
if let Some(e) = end {
- if entry.sort_key() == e {
+ let is_finished = match enumeration_order {
+ EnumerationOrder::Forward => entry.sort_key() >= e,
+ EnumerationOrder::Reverse => entry.sort_key() <= e,
+ };
+ if is_finished {
return Ok((entries, false, None));
}
}