Skip to content

Commit 87e33ce

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 87e33ce

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/goto-programs/interpreter_evaluate.cpp

Lines changed: 8 additions & 8 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)
348+
if(expr.has_operands())
349349
{
350-
evaluate(expr.op0(), dest);
351-
return;
352-
}
353-
else if(expr.has_operands())
354-
{
355-
if(const auto i = numeric_cast<mp_integer>(expr.op0()))
350+
if(expr.op0().id() == ID_address_of)
351+
{
352+
evaluate(expr.op0(), dest);
353+
return;
354+
}
355+
else 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)