Skip to content

Commit 3efc250

Browse files
committed
prefer option
1 parent e6bf0b6 commit 3efc250

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

CodeHawk/CHC/cchanalyze/cCHCallTranslator.ml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,9 @@ let is_library_function (fname:string): bool =
8080
if CCHDeclarations.cdeclarations#has_varinfo_by_name fname then
8181
let varinfo = CCHDeclarations.cdeclarations#get_varinfo_by_name fname in
8282
(* starts with '/' ? *)
83-
try
84-
String.index_from varinfo.vdecl.file 0 '/' = 0
85-
with
86-
| Invalid_argument _
87-
| Not_found -> false
83+
match String.index_opt varinfo.vdecl.file '/' with
84+
| Some i -> i = 0
85+
| _ -> false
8886
else
8987
false
9088

0 commit comments

Comments
 (0)