fix day 12 performance regerssion
caused by a change to Grid.at_e that would eagerly format an exception string even if the function never throws an exception.
This commit is contained in:
1 parent
d203c9a520
commit
950f2860df
1 file changed
+3
-2
+3
-2
@@ -27,8 +27,9 @@ let at grid point =
|
||||
;;
|
||||
|
||||
let at_e (grid : 'a t) (point : Vec2.t) =
|
||||
Option.get_exn_or (Format.sprintf "point %a out of bounds!" Vec2.pp point)
|
||||
@@ at grid point
|
||||
match at grid point with
|
||||
| Some point -> point
|
||||
| None -> failwith @@ Format.sprintf "point %a out of bounds!" Vec2.pp point
|
||||
;;
|
||||
|
||||
let set_e grid point item =
|
||||
|
||||
Reference in new issue
Block a user