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:
parent
d203c9a520
commit
950f2860df
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user