From: Richard Kreckel Date: Tue, 24 Nov 2015 10:57:35 +0000 (+0100) Subject: Avoid some explicit copying of STL containers. X-Git-Tag: release_1-7-0~7^2~51 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=33e537213bf028c7c1ceec4ba7c66ef46c5d6722;p=ginac.git Avoid some explicit copying of STL containers. --- diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index 0e67ec9a..e6bd91a7 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -715,8 +715,8 @@ void expairseq::construct_from_2_expairseq(const expairseq &s1, } if (needs_further_processing) { - epvector v = seq; - seq.clear(); + // Clear seq and start over. + epvector v = std::move(seq); construct_from_epvector(std::move(v)); } } @@ -776,8 +776,8 @@ void expairseq::construct_from_expairseq_ex(const expairseq &s, } if (needs_further_processing) { - epvector v = seq; - seq.clear(); + // Clear seq and start over. + epvector v = std::move(seq); construct_from_epvector(std::move(v)); } } @@ -964,8 +964,8 @@ void expairseq::combine_same_terms_sorted_seq() seq.erase(itout,last); if (needs_further_processing) { - epvector v = seq; - seq.clear(); + // Clear seq and start over. + epvector v = std::move(seq); construct_from_epvector(std::move(v)); } } diff --git a/ginac/matrix.cpp b/ginac/matrix.cpp index 52a1f1b4..2217bae8 100644 --- a/ginac/matrix.cpp +++ b/ginac/matrix.cpp @@ -1221,9 +1221,8 @@ ex matrix::determinant_minor() const for (unsigned j=fc; j