Skip to content

Commit

Permalink
CP-52225 - oxenstored: Use String.for_all to simplify name check
Browse files Browse the repository at this point in the history
Signed-off-by: Frediano Ziglio <[email protected]>
  • Loading branch information
freddy77 authored and last-genius committed Dec 12, 2024
1 parent 6407a06 commit c2ea82f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions oxenstored/store.ml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ module Path = struct
|| c = '-'
|| c = '@'

let name_is_valid name =
name <> ""
&& String.fold_left (fun accu c -> accu && char_is_valid c) true name
let name_is_valid name = name <> "" && String.for_all char_is_valid name

let is_valid path = List.for_all name_is_valid path

Expand Down

0 comments on commit c2ea82f

Please sign in to comment.