mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-09 14:19:22 +00:00
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1408 Co-authored-by: Alex Auvolat <lx@deuxfleurs.fr> Co-committed-by: Alex Auvolat <lx@deuxfleurs.fr>
This commit is contained in:
+7
-3
@@ -222,9 +222,13 @@ impl Tree {
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_gt<T: AsRef<[u8]>>(&self, from: T) -> Result<Option<(Value, Value)>> {
|
||||
self.range((Bound::Excluded(from), Bound::Unbounded))?
|
||||
.next()
|
||||
.transpose()
|
||||
if from.as_ref().is_empty() {
|
||||
self.iter()?.next().transpose()
|
||||
} else {
|
||||
self.range((Bound::Excluded(from), Bound::Unbounded))?
|
||||
.next()
|
||||
.transpose()
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the old value if there was one
|
||||
|
||||
Reference in New Issue
Block a user