diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-02 18:51:57 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-05-13 19:18:59 +0000 |
commit | 7cba2acd2cc4b68b5a4de2251ab555adb09bf7e8 (patch) | |
tree | e4f6453417becfd6df89f6c21bfae549db850cde /qmake/library/qmakeevaluator.cpp | |
parent | ac4cf6e2b2dfc6ee37b0c64e1dd201e2b2452c31 (diff) |
qmake: replace QLinkedList with std::list
This is in preparation of deprecating QLinkedList.
There is but one substantial change: Instead of copying the linked list,
we move it now, and instead of copying items between these two lists, we
use std::list::splice(), which just relinks nodes. It is a bit surprising
that the comment on the ProValueMapStack suggests references into the
container must remain stable, and then some code changes addresses by
making copies of the elements.
This was probably a bug waiting to manifest itself.
Since nothing else in qmake is using QLinkedList now, remove qlinkedlist.o
from the qmake build.
Change-Id: I08a5b0661466bf50ad8f9f8abf58bc801aef4ddc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/library/qmakeevaluator.cpp')
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index d7ff4ede39..c9dc7bd80b 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -601,14 +601,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock( case TokBypassNesting: blockLen = getBlockLen(tokPtr); if ((m_cumulative || okey != or_op) && blockLen) { - ProValueMapStack savedValuemapStack = m_valuemapStack; + ProValueMapStack savedValuemapStack = std::move(m_valuemapStack); m_valuemapStack.clear(); - m_valuemapStack.append(savedValuemapStack.takeFirst()); + m_valuemapStack.splice(m_valuemapStack.end(), + savedValuemapStack, savedValuemapStack.begin()); traceMsg("visiting nesting-bypassing block"); ret = visitProBlock(tokPtr); traceMsg("visited nesting-bypassing block"); - savedValuemapStack.prepend(m_valuemapStack.first()); - m_valuemapStack = savedValuemapStack; + savedValuemapStack.splice(savedValuemapStack.begin(), + m_valuemapStack, m_valuemapStack.begin()); + m_valuemapStack = std::move(savedValuemapStack); } else { traceMsg("skipped nesting-bypassing block"); ret = ReturnTrue; |