- const ex evaled_ex = cit->rest.eval(level);
- if (!are_ex_trivially_equal(cit->rest,evaled_ex)) {
-
- // something changed, copy seq, eval and return it
+ const expair evaled_pair = combine_ex_with_coeff_to_pair(cit->rest, cit->coeff);
+ if (unlikely(!evaled_pair.is_equal(*cit))) {
+
+ // something changed: copy seq, eval and return it