File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -200,8 +200,9 @@ let set_method table label element =
200
200
table.hidden_meths < - (label, element) :: table.hidden_meths
201
201
202
202
let get_method table label =
203
- try List. assoc label table.hidden_meths
204
- with Not_found -> table.methods.(label)
203
+ match List. assoc_opt label table.hidden_meths with
204
+ | Some x -> x
205
+ | None -> table.methods.(label)
205
206
206
207
let to_list arr =
207
208
if arr == Obj. magic 0 then [] else Array. to_list arr
@@ -228,7 +229,9 @@ let narrow table vars virt_meths concr_meths =
228
229
by_name := Meths. add met label ! by_name;
229
230
by_label :=
230
231
Labs. add label
231
- (try Labs. find label table.methods_by_label with Not_found -> true )
232
+ (match Labs. find_opt label table.methods_by_label with
233
+ | Some x -> x
234
+ | None -> true )
232
235
! by_label)
233
236
concr_meths concr_meth_labs;
234
237
List. iter2
@@ -269,8 +272,9 @@ let new_slot table =
269
272
index
270
273
271
274
let new_variable table name =
272
- try Vars. find name table.vars
273
- with Not_found ->
275
+ match Vars. find_opt name table.vars with
276
+ | Some x -> x
277
+ | None ->
274
278
let index = new_slot table in
275
279
if name <> " " then table.vars < - Vars. add name index table.vars;
276
280
index
You can’t perform that action at this time.
0 commit comments