Partitions gets a new get_with_keys?
function, for consistency.
This commit is contained in:
parent
255cfe4162
commit
7272b9fe6f
@ -137,6 +137,14 @@ class DODB::Partition(V) < DODB::Indexer(V)
|
|||||||
r_value
|
r_value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Safe version of `#get_with_keys`.
|
||||||
|
# NOTE: returns an empty list on empty or non-existing partition.
|
||||||
|
def get_with_keys?(partition : String) : Array(Tuple(V, Int32))
|
||||||
|
get_with_keys partition
|
||||||
|
rescue MissingEntry
|
||||||
|
Array(Tuple(V, Int32)).new
|
||||||
|
end
|
||||||
|
|
||||||
# Deletes all entries within the provided partition.
|
# Deletes all entries within the provided partition.
|
||||||
#
|
#
|
||||||
# ```
|
# ```
|
||||||
|
Loading…
Reference in New Issue
Block a user