From: Richard Kreckel Date: Wed, 25 Nov 2015 10:28:10 +0000 (+0100) Subject: In power::expand_add(), don't reserve excess monomial sizes. X-Git-Tag: ginac_1-6-6~4 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=2639812c0ba4e1f9620660bbba1f12bf5b865e29;hp=2639812c0ba4e1f9620660bbba1f12bf5b865e29 In power::expand_add(), don't reserve excess monomial sizes. There is no need to reserve n terms in each of the monomials of the result of power(+(x,y,z...;0),n): We can compute it exactly as the number of nonzero exponents in the multinomial expansion. The good thing is that this counting is the same for each composition of a partition, so it can be hoisted out of the loop over compositions. ---