diff options
Diffstat (limited to 'include/phat')
-rw-r--r-- | include/phat/representations/vector_vector.h | 5 |
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 ) );
|