From 19aed83caebcae1103e0c4f6e200744492f17545 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 24 Apr 2020 15:17:37 +0200 Subject: Use Hashtbl.find_opt. Replace the pattern `try Some (Hashtbl.find ...) with Not_found -> None` by a call to the function Hashtbl.find_opt. --- cparser/Bitfields.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cparser') diff --git a/cparser/Bitfields.ml b/cparser/Bitfields.ml index 9ca40e70..7a00f719 100644 --- a/cparser/Bitfields.ml +++ b/cparser/Bitfields.ml @@ -50,8 +50,7 @@ let bitfield_table = (Hashtbl.create 57: (ident * string, bitfield_info) Hashtbl.t) let is_bitfield structid fieldname = - try Some (Hashtbl.find bitfield_table (structid, fieldname)) - with Not_found -> None + Hashtbl.find_opt bitfield_table (structid, fieldname) (* Mapping struct/union identifier -> list of members after transformation, including the carrier fields, but without the bit fields. -- cgit