From bc302285a11183fc28eef7450f608df0a85c9cb6 Mon Sep 17 00:00:00 2001 From: Lev Nachmanson Date: Wed, 11 Dec 2019 09:28:12 -1000 Subject: [PATCH] integrating NB suggestions Signed-off-by: Lev Nachmanson --- src/math/lp/nex_creator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/math/lp/nex_creator.cpp b/src/math/lp/nex_creator.cpp index c32ae72fd..1e1bec6e1 100644 --- a/src/math/lp/nex_creator.cpp +++ b/src/math/lp/nex_creator.cpp @@ -89,8 +89,8 @@ bool nex_creator::eat_scalar_pow(rational& r, const nex_pow& p, unsigned pow) { void nex_creator::simplify_children_of_mul(vector & children, rational& coeff) { TRACE("grobner_d", print_vector(children, tout);); vector to_promote; - int skipped = 0; - for (unsigned j = 0; j < children.size(); j++) { + bool skipped = false; + for (nex_pow& p : children.size()) { nex_pow& p = children[j]; if (eat_scalar_pow(coeff, p, 1)) { skipped++; @@ -654,8 +654,9 @@ void nex_creator::simplify_children_of_sum(ptr_vector & children) { continue; } else { - if (skipped) - children[j++] = e; + if (skipped) + children[j] = e; + j++; } } children.shrink(j);