Skip to content

Commit

Permalink
Use List.mem instead of List.exists
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Jan 31, 2025
1 parent adc71bc commit 0035350
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion src/autoTune.ml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ let reduceAnalyses () =
| _ -> LibraryDesc.Accesses.find_kind desc.accs Spawn args <> []
in
let hasThreadCreate = hasFunction isThreadCreate in
let hasDataRaceSpec = List.exists (SvcompSpec.equals SvcompSpec.NoDataRace) (Svcomp.Specification.of_option ()) in
let hasDataRaceSpec = List.mem SvcompSpec.NoDataRace (Svcomp.Specification.of_option ()) in
let disable reason analyses =
Logs.info "%s -> disabling analyses \"%s\"" reason (String.concat ", " analyses);
disableAnalyses analyses
Expand Down
12 changes: 0 additions & 12 deletions src/witness/svcompSpec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,3 @@ let to_string spec =

let to_string spec =
String.concat "\n" (List.map to_string spec)

let equals spec1 spec2 =
match spec1, spec2 with
| UnreachCall f1, UnreachCall f2 -> String.equal f1 f2
| NoDataRace, NoDataRace
| NoOverflow, NoOverflow
| Termination, Termination
| ValidFree, ValidFree
| ValidDeref, ValidDeref
| ValidMemtrack, ValidMemtrack
| ValidMemcleanup, ValidMemcleanup -> true
| _, _ -> false

0 comments on commit 0035350

Please sign in to comment.