This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Trivial iter_swap cleanup
- From: François Dumont <frs dot dumont at gmail dot com>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 May 2017 22:33:15 +0200
- Subject: Trivial iter_swap cleanup
- Authentication-results: sourceware.org; auth=none
Hi
A trivial code simplification in a pre-C++11 piece of code.
Ok to commit ?
François
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index d15be63..a33dde2 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -66,7 +66,7 @@
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
#include <bits/concept_check.h>
-#include <bits/move.h> // For std::swap and _GLIBCXX_MOVE
+#include <bits/move.h> // For std::swap
#include <bits/predefined_ops.h>
namespace std _GLIBCXX_VISIBILITY(default)
@@ -86,9 +86,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
typedef typename iterator_traits<_ForwardIterator1>::value_type
_ValueType1;
- _ValueType1 __tmp = _GLIBCXX_MOVE(*__a);
- *__a = _GLIBCXX_MOVE(*__b);
- *__b = _GLIBCXX_MOVE(__tmp);
+ _ValueType1 __tmp = *__a;
+ *__a = *__b;
+ *__b = __tmp;
}
};