Skip to content

Commit

Permalink
Tweak order in Map.of_list error (#645)
Browse files Browse the repository at this point in the history
We should show the key that came earlier in the list first
  • Loading branch information
rgrinberg authored and jeremiedimino committed Mar 20, 2018
1 parent d2c85e3 commit 994fb12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stdune/map.ml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ module Make(Key : Comparable.S) : S with type key = Key.t = struct
| [] -> Result.Ok acc
| (k, v) :: l ->
match find acc k with
| None -> loop (add acc k v) l
| Some v' -> Error (k, v, v')
| None -> loop (add acc k v) l
| Some v_old -> Error (k, v_old, v)
in
fun l -> loop empty l

Expand Down

0 comments on commit 994fb12

Please sign in to comment.