From 57e024cc81c55b8c442db9f719f19aebb321ef37 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 18 Jan 2016 12:45:11 +0100 Subject: Avoid shadowing a name (and use the outer variable an extra time) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QDateTimeParser::parseFormat()'s top-level scope has a const int max; this was shadowed by a short-lived max in an inner scope; and the outer scope's max could be re-used one more time after that to save re-evaluating the same unchanged expression it held. Change-Id: I9f07452bb0b4e5ff4bcf6396d42d1419de6276fa Reviewed-by: Thiago Macieira Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qdatetimeparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qdatetimeparser.cpp') diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 99a324a728..3cf926ca8f 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -494,15 +494,15 @@ bool QDateTimeParser::parseFormat(const QString &newFormat) } if ((newDisplay & (AmPmSection|Hour12Section)) == Hour12Section) { - const int max = newSectionNodes.size(); - for (int i=0; i