Skip to content

Commit 86b5e11

Browse files
author
thk123
committed
Simplify if statement
Without branching it is simpler to see what the condition is
1 parent 13b5e2b commit 86b5e11

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/solvers/flattening/pointer_logic.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ Author: Daniel Kroening, [email protected]
2323

2424
bool pointer_logict::is_dynamic_object(const exprt &expr) const
2525
{
26-
if(expr.type().get_bool(ID_C_dynamic))
27-
return true;
28-
29-
if(expr.id()==ID_symbol)
30-
if(has_prefix(
31-
id2string(to_symbol_expr(expr).get_identifier()),
32-
SYMEX_DYNAMIC_PREFIX))
33-
return true;
34-
35-
return false;
26+
return expr.type().get_bool(ID_C_dynamic) ||
27+
(expr.id() == ID_symbol &&
28+
has_prefix(
29+
id2string(to_symbol_expr(expr).get_identifier()),
30+
SYMEX_DYNAMIC_PREFIX));
3631
}
3732

3833
void pointer_logict::get_dynamic_objects(std::vector<std::size_t> &o) const

0 commit comments

Comments
 (0)