Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Sep 25, 2024
1 parent caef69a commit 9f19452
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/core/opamStd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,11 @@ module OpamString = struct
let acc = ref [] in
let in_run = ref false in
let slice_start = ref 0 in

for i=0 to String.length s-1 do
if String.get s i = c then (
let len = String.length s in
for i=0 to len-1 do
if (String.get s i : char) = (c : char) then (
if not !in_run then (
if i > !slice_start then
if (i : int) > (!slice_start : int) then
acc := String.sub s !slice_start (i - !slice_start) :: !acc;
in_run := true;
)
Expand All @@ -710,8 +710,8 @@ module OpamString = struct
)
)
done;
if not !in_run && !slice_start < String.length s then
acc := String.sub s !slice_start (String.length s - !slice_start) :: !acc;
if not !in_run && (!slice_start : int) < (len : int) then
acc := String.sub s !slice_start (len - !slice_start) :: !acc;
List.rev !acc

let split_delim s c =
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/bench.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ let () =
in
let time_show_with_depexts =
Gc.compact ();
time_cmd ~exit:0 (fmt "%s show conf-autoconf" bin)
time_cmd ~exit:0 (fmt "%s show conf-pkg-config" bin)
in
let time_show_raw =
Gc.compact ();
time_cmd ~exit:0 (fmt "%s show --raw conf-autoconf" bin)
time_cmd ~exit:0 (fmt "%s show --raw conf-pkg-config" bin)
in
let time_show_precise =
Gc.compact ();
time_cmd ~exit:0 (fmt "%s show --raw conf-autoconf.0.1" bin)
time_cmd ~exit:0 (fmt "%s show --raw conf-pkg-config.2" bin)
in
let json = fmt {|{
"results": [
Expand Down

0 comments on commit 9f19452

Please sign in to comment.