lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 804111d 04/46: Remove unnecessary use of std:


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 804111d 04/46: Remove unnecessary use of std::swap()
Date: Wed, 22 Jul 2020 11:05:09 -0400 (EDT)

branch: master
commit 804111d4b1a9373e48c767df323273f26972f7f8
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Vadim Zeitlin <vadim@tt-solutions.com>

    Remove unnecessary use of std::swap()
    
    This could be useful to avoid copying in C++98, but since C++11 we can
    simply use move-assignment instead, so do it as the intention of the
    code is to only update visible_columns_, not to swap anything.
---
 census_view.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/census_view.cpp b/census_view.cpp
index 3b5fa7e..a3334b0 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -1648,7 +1648,7 @@ class CensusViewGridTable
 
     void set_visible_columns(std::vector<int>&& new_visible_columns)
     {
-        std::swap(new_visible_columns, visible_columns_);
+        visible_columns_ = std::move(new_visible_columns);
     }
 
   private:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]