Skip to content

Commit 2d14b22

Browse files
authored
Merge pull request diffblue#2545 from tautschnig/vs-unnecessary
Avoid unncessary signed/unsigned conversion
2 parents ff0414e + 6dc6ea9 commit 2d14b22

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/goto-instrument/accelerate/polynomial.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,8 @@ void polynomialt::from_expr(const exprt &expr)
138138
}
139139
else if(expr.id()==ID_constant)
140140
{
141-
mp_integer mp;
142-
unsigned int l;
143-
constant_exprt const_expr=to_constant_expr(expr);
144-
145-
mp=binary2integer(const_expr.get_value().c_str(), true);
146-
l=mp.to_long();
147-
148141
monomialt monomial;
149-
monomial.coeff=l;
142+
monomial.coeff = numeric_cast_v<int>(expr);
150143

151144
monomials.push_back(monomial);
152145
}

0 commit comments

Comments
 (0)