From 8a8b2250a8a71135e26a6422edbc3cace10e5a99 Mon Sep 17 00:00:00 2001 From: redi Date: Tue, 3 Jun 2014 17:26:31 +0000 Subject: * include/bits/regex_executor.tcc (_Executor<>::_M_main): Move instead of copying. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@211193 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/bits/regex_executor.tcc | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'libstdc++-v3') diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index eb23bed260f..55ccdfaa2b5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2014-06-03 Jonathan Wakely + + * include/bits/regex_executor.tcc (_Executor<>::_M_main): Move instead + of copying. + 2014-06-03 Jonathan Wakely Backport from mainline diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc index 68a5e0490f9..052302b91f7 100644 --- a/libstdc++-v3/include/bits/regex_executor.tcc +++ b/libstdc++-v3/include/bits/regex_executor.tcc @@ -120,10 +120,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (_M_match_queue->empty()) break; _M_visited->assign(_M_visited->size(), false); - auto _M_old_queue = std::move(*_M_match_queue); - for (auto __task : _M_old_queue) + auto __old_queue = std::move(*_M_match_queue); + for (auto& __task : __old_queue) { - _M_cur_results = __task.second; + _M_cur_results = std::move(__task.second); _M_dfs<__match_mode>(__task.first); } if (!__match_mode) -- cgit v1.2.1