From: David Wells Date: Sat, 1 Apr 2017 16:53:08 +0000 (-0400) Subject: Use a swap in place of a copy. X-Git-Tag: v9.0.0-rc1~1746^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb5db19276;p=dealii.git Use a swap in place of a copy. --- diff --git a/source/base/partitioner.cc b/source/base/partitioner.cc index 63f3edc9e3..3f4d01522b 100644 --- a/source/base/partitioner.cc +++ b/source/base/partitioner.cc @@ -269,6 +269,7 @@ namespace Utilities // allocate memory for import data std::vector > import_targets_temp; + import_targets_temp.reserve(n_procs); n_import_indices_data = 0; for (unsigned int i=0; i 0) @@ -277,7 +278,8 @@ namespace Utilities import_targets_temp.push_back(std::pair (i, receive_buffer[i])); } - import_targets_data = import_targets_temp; + + import_targets_data = std::move(import_targets_temp); } // send and receive indices for import data. non-blocking receives and