aboutsummaryrefslogtreecommitdiffstats
path: root/cparser
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2020-04-24 15:17:37 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2020-06-28 10:07:02 +0200
commit19aed83caebcae1103e0c4f6e200744492f17545 (patch)
tree8d15976e55751216b0af7885e508e9878d38261f /cparser
parent7fe7aabe4bac5a2250f31045797fce663ec65848 (diff)
downloadcompcert-kvx-19aed83caebcae1103e0c4f6e200744492f17545.tar.gz
compcert-kvx-19aed83caebcae1103e0c4f6e200744492f17545.zip
Use Hashtbl.find_opt.
Replace the pattern `try Some (Hashtbl.find ...) with Not_found -> None` by a call to the function Hashtbl.find_opt.
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Bitfields.ml3
1 files changed, 1 insertions, 2 deletions
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.