Skip to content

Commit

Permalink
restore the logic of right_range in serivices-memory
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorgan committed Aug 22, 2024
1 parent 99f7a7a commit 97102ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/services/memory/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ impl typed_kv::Adapter for Adapter {
let keys: Vec<_> = if path.is_empty() {
inner.keys().cloned().collect()
} else {
let right_range = format!("{}{}", path, std::char::MAX);
let right_range = if let Some(path) = path.strip_suffix('/') {
format!("{}0", path)
} else {
format!("{}{}", path, std::char::MAX)
};
inner
.range(path.to_string()..right_range)
.map(|(k, _)| k.to_string())
Expand Down

0 comments on commit 97102ea

Please sign in to comment.