Skip to content

Commit

Permalink
cohttp.headers: use String.equal
Browse files Browse the repository at this point in the history
Signed-off-by: Marcello Seri <[email protected]>
  • Loading branch information
mseri committed Apr 23, 2021
1 parent 8a9d2da commit c5f8bc7
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions cohttp/src/header.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,7 @@ end = struct

let of_string x = String.lowercase_ascii x
let to_string x = x

let equal x y =
let len = String.length x in
len = String.length y
&&
let equal_so_far = ref true in
let i = ref 0 in
while !equal_so_far && !i < len do
let c1 = String.unsafe_get x !i in
let c2 = String.unsafe_get y !i in
equal_so_far := c1 = c2;
incr i
done;
!equal_so_far
let equal x y = String.equal x y
end

type t = (LString.t * string) list
Expand Down

0 comments on commit c5f8bc7

Please sign in to comment.