Skip to content

Commit

Permalink
Fix semgrep warning for using List.length for an emptiness check
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstanb committed Nov 15, 2023
1 parent 0bec1ac commit 8459104
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/analyses/memLeak.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct
| Queries.VD.Struct s ->
let struct_fields = ValueDomain.Structs.keys s in
let ptr_struct_fields = List.filter (fun f -> isPointerType f.ftype) struct_fields in
if List.length ptr_struct_fields = 0 then None else Some (s, ptr_struct_fields)
if ptr_struct_fields = [] then None else Some (s, ptr_struct_fields)
| _ -> None
end
| _ -> None
Expand Down

0 comments on commit 8459104

Please sign in to comment.