Skip to content

Do not use count() when returning a bool #2404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions jbmc/src/java_bytecode/java_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,10 @@ resolve_inherited_componentt::inherited_componentt get_inherited_component(
/// \return true if this static field is known never to be null
bool is_non_null_library_global(const irep_idt &symbolid)
{
static const std::unordered_set<irep_idt> non_null_globals = {
"java::java.lang.System.out",
"java::java.lang.System.err",
"java::java.lang.System.in"};
return non_null_globals.count(symbolid);
static const irep_idt in = "java::java.lang.System.in";
static const irep_idt out = "java::java.lang.System.out";
static const irep_idt err = "java::java.lang.System.err";
return symbolid == in || symbolid == out || symbolid == err;
}

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