From eb5db19276b20829b1d74223a3435688b1e4a12f Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 1 Apr 2017 12:53:08 -0400 Subject: [PATCH] Use a swap in place of a copy. --- source/base/partitioner.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.39.5