Skip to content

Commit c2a8fb8

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 62ec461 commit c2a8fb8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

jbmc/src/java_bytecode/java_utils.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,10 @@ 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 = {
424-
"java::java.lang.System.out",
425-
"java::java.lang.System.err",
426-
"java::java.lang.System.in"};
427-
return non_null_globals.count(symbolid);
423+
static const irep_idt in = "java::java.lang.System.in";
424+
static const irep_idt out = "java::java.lang.System.out";
425+
static const irep_idt err = "java::java.lang.System.err";
426+
return symbolid == in || symbolid == out || symbolid == err;
428427
}
429428

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

0 commit comments

Comments
 (0)