Skip to content

Commit

Permalink
Remove unused erase_values abstract store function.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoj613 committed Jul 19, 2024
1 parent 8f38294 commit d32d168
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
4 changes: 0 additions & 4 deletions lib/storage/filesystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ module Impl = struct
(key_to_fspath t key)
(fun ic -> In_channel.length ic |> Int64.to_int)

let erase_values t keys =
Storage_intf.Base.erase_values
~erase_fn:erase t keys

let erase_prefix t pre =
Storage_intf.Base.erase_prefix
~list_fn:list ~erase_fn:erase t pre
Expand Down
3 changes: 0 additions & 3 deletions lib/storage/memory.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ module Impl = struct
Storage_intf.Base.set_partial_values
~set_fn:set ~get_fn:get t key append rv

let erase_values t keys =
Storage_intf.Base.erase_values ~erase_fn:erase t keys

let list_prefix t pre =
Storage_intf.Base.list_prefix ~list_fn:list t pre

Expand Down
6 changes: 1 addition & 5 deletions lib/storage/storage_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module type STORE = sig
val set : t -> key -> string -> unit
val set_partial_values : t -> key -> ?append:bool -> (int * string) list -> unit
val erase : t -> key -> unit
val erase_values : t -> key list -> unit
val erase_prefix : t -> key -> unit
val list : t -> key list
val list_prefix : t -> key -> key list
Expand Down Expand Up @@ -190,11 +189,8 @@ module Base = struct
(String.starts_with ~prefix:pre)
(list_fn t)

let erase_values ~erase_fn t keys =
StrSet.iter (erase_fn t) @@ StrSet.of_list keys

let erase_prefix ~list_fn ~erase_fn t pre =
erase_values ~erase_fn t @@ list_prefix ~list_fn t pre
List.iter (erase_fn t) @@ list_prefix ~list_fn t pre

let list_dir ~list_fn t pre =
let n = String.length pre in
Expand Down

0 comments on commit d32d168

Please sign in to comment.