From e764f345834cfc5052967da100cc26900a97fbb5 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Thu, 15 Dec 2016 10:57:13 +0100 Subject: QDateTimeParser: simpler return, clearer comment skipToNextSection() returned via a local temp that served no purpose. The accompanying comment didn't quite explain what it set out to. Change-Id: I31581323df374653db9c2558a3bd63409aafb178 Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetimeparser.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/corelib/tools/qdatetimeparser.cpp') diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 6a9d1fbc69..d49bec5f76 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1594,14 +1594,13 @@ bool QDateTimeParser::skipToNextSection(int index, const QDateTime ¤t, con if (pos < 0 || pos >= text.size()) pos = -1; - const bool potential = potentialValue(text, min, max, index, current, pos); - return !potential; - - /* If the value potentially can become another valid entry we - * don't want to skip to the next. E.g. In a M field (month - * without leading 0 if you type 1 we don't want to autoskip but - * if you type 3 we do + /* + If the value potentially can become another valid entry we don't want to + skip to the next. E.g. In a M field (month without leading 0) if you type + 1 we don't want to autoskip (there might be [012] following) but if you + type 3 we do. */ + return !potentialValue(text, min, max, index, current, pos); } /*! -- cgit v1.2.3