summaryrefslogtreecommitdiff
path: root/include/phat/representations/vector_vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/phat/representations/vector_vector.h')
-rw-r--r--include/phat/representations/vector_vector.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/phat/representations/vector_vector.h b/include/phat/representations/vector_vector.h
index c313c20..bdef522 100644
--- a/include/phat/representations/vector_vector.h
+++ b/include/phat/representations/vector_vector.h
@@ -80,8 +80,9 @@ namespace phat {
void _add_to( index source, index target ) {
column& source_col = matrix[ source ];
column& target_col = matrix[ target ];
- column temp_col = target_col;
- target_col.clear();
+ column temp_col;
+ target_col.swap( temp_col );
+ target_col.reserve( temp_col.size() );
std::set_symmetric_difference( temp_col.begin(), temp_col.end(),
source_col.begin(), source_col.end(),
std::back_inserter( target_col ) );