Skip to content

Commit f1db4e5

Browse files
committed
Do not use count() when returning a bool
Visual Studio complains about the conversion. Here, constructing an elaborate container (including heap-allocated memory) is unnecessary.
1 parent 8f6dab8 commit f1db4e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jbmc/src/java_bytecode/java_utils.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,13 @@ resolve_inherited_componentt::inherited_componentt get_inherited_component(
420420
/// \return true if this static field is known never to be null
421421
bool is_non_null_library_global(const irep_idt &symbolid)
422422
{
423-
static const std::unordered_set<irep_idt> non_null_globals = {
423+
static const irep_idt non_null_globals[] = {
424424
"java::java.lang.System.out",
425425
"java::java.lang.System.err",
426426
"java::java.lang.System.in"};
427-
return non_null_globals.count(symbolid);
427+
return symbolid == non_null_globals[0] ||
428+
symbolid == non_null_globals[1] ||
429+
symbolid == non_null_globals[2];
428430
}
429431

430432
/// Methods belonging to the class org.cprover.CProver that should be ignored

0 commit comments

Comments
 (0)