Skip to content

Commit

Permalink
declare gc_vector outside loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud authored and mikestillman committed Mar 13, 2023
1 parent 3f00e40 commit 6968ab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion M2/Macaulay2/e/poly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1339,12 +1339,12 @@ ring_elem PolyRing::eval(const RingMap *map,
// The way we collect the result depends on whether the target ring
// is a polynomial ring: if so, use a heap structure. If not, just add to the
// result.
gc_vector<int> vp;
const Ring *target = map->get_ring();
SumCollector *H = target->make_SumCollector();

for (Nterm& t : f)
{
gc_vector<int> vp;
M_->to_varpower(t.monom, vp);
H->add(map->eval_term(K_, t.coeff, vp.data(), first_var, n_vars()));
}
Expand Down

0 comments on commit 6968ab3

Please sign in to comment.