Skip to content

Commit d6a0dc7

Browse files
Merge the expr.has_operands conditions in one if
This makes the conditions in the `if` a bit simpler.
1 parent 02d09c5 commit d6a0dc7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/goto-programs/interpreter_evaluate.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,21 +345,21 @@ void interpretert::evaluate(
345345
}
346346
else if(expr.type().id() == ID_pointer)
347347
{
348-
if(expr.has_operands() && expr.op0().id()==ID_address_of)
349-
{
350-
evaluate(expr.op0(), dest);
351-
return;
352-
}
353-
else if(expr.has_operands())
348+
if(expr.has_operands())
354349
{
350+
if(expr.op0().id() == ID_address_of)
351+
{
352+
evaluate(expr.op0(), dest);
353+
return;
354+
}
355355
if(const auto i = numeric_cast<mp_integer>(expr.op0()))
356356
{
357357
dest.push_back(*i);
358358
return;
359359
}
360360
}
361361
// check if expression is constant null pointer without operands
362-
else if(!expr.has_operands())
362+
else
363363
{
364364
const auto i = numeric_cast<mp_integer>(expr);
365365
if(i && i->is_zero())

0 commit comments

Comments
 (0)