* Implementation of GiNaC's non-commutative products of expressions. */
/*
- * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (assocseq.empty()) return _ex1;
// determine return types
- unsignedvector rettypes;
- rettypes.reserve(assocseq.size());
+ unsignedvector rettypes(assocseq.size());
size_t i = 0;
size_t count_commutative=0;
size_t count_noncommutative=0;
size_t count_noncommutative_composite=0;
cit = assocseq.begin(); citend = assocseq.end();
while (cit != citend) {
- switch (rettypes[i] = cit->return_type()) {
+ rettypes[i] = cit->return_type();
+ switch (rettypes[i]) {
case return_types::commutative:
count_commutative++;
break;