Use swap() and move() to reduce copying in formEllipticSystem().

This commit is contained in:
Atgeirr Flø Rasmussen committed 2015-03-16 14:22:32 +01:00
1 parent 5ff65b40e1
commit f0ba4a5797
1 file changed
+2 -2
+2 -2
View File
@@ -396,7 +396,7 @@ namespace Opm
// A concession to MRST, to obtain more similar behaviour:
// swap the first two equations, so that oil is first, then water.
auto eqs = eqs_in;
std::swap(eqs[0], eqs[1]);
eqs[0].swap(eqs[1]);
// Characterize the material balance equations.
const int n = eqs[0].size();
@@ -463,7 +463,7 @@ namespace Opm
L.setFromTriplets(t.begin(), t.end());
// Combine in single block.
ADB total_residual = eqs[0];
ADB total_residual = std::move(eqs[0]);
for (int phase = 1; phase < num_phases; ++phase) {
total_residual = vertcat(total_residual, eqs[phase]);
}