From 0b20348321b0c5663e46f293ed0ceb3c68594e63 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 19 Oct 2017 10:35:38 +0200 Subject: Fix clazy-temporary-iterator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I512ffb927cfa161fc810c846a7b57b02601b14b9 Reviewed-by: Sérgio Martins --- src/xmlpatterns/expr/qexpressionsequence.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/xmlpatterns/expr/qexpressionsequence.cpp') diff --git a/src/xmlpatterns/expr/qexpressionsequence.cpp b/src/xmlpatterns/expr/qexpressionsequence.cpp index 193e15f..d796de4 100644 --- a/src/xmlpatterns/expr/qexpressionsequence.cpp +++ b/src/xmlpatterns/expr/qexpressionsequence.cpp @@ -46,6 +46,9 @@ #include "qexpressionsequence_p.h" +#include +#include + QT_BEGIN_NAMESPACE using namespace QPatternist; @@ -109,11 +112,8 @@ Expression::Ptr ExpressionSequence::compress(const StaticContext::Ptr &context) else if(Id == IDExpressionSequence) { /* Rewrite "(1, (2, 3), 4)" into "(1, 2, 3, 4)" */ - Expression::List::const_iterator seqIt((*it)->operands().constBegin()); - const Expression::List::const_iterator seqEnd((*it)->operands().constEnd()); - - for(; seqIt != seqEnd; ++seqIt) - result.append(*seqIt); + const auto &operands = (*it)->operands(); + std::copy(operands.cbegin(), operands.cend(), std::back_inserter(result)); } else if (Id == IDLiteralSequence) { /* Rewrite "(1, (2, 3), 4)" into "(1, 2, 3, 4)" */ // Note: LiteralSequence does not use the dynamic context, so we pass in a nullptr. -- cgit v1.2.1