diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2016-12-15 10:55:54 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2017-06-20 09:54:45 +0000 |
commit | c24ad1896a7e877383505daccdc9db56d32709ff (patch) | |
tree | e39b27334c5051d4aa0d89c332743c2dd3949e8b /src/corelib/tools/qdatetimeparser_p.h | |
parent | 0fdbd239c0504f3f7a7659261bae1cbb10c2bb06 (diff) |
Eliminate in/out arguments from QDateTimeParser::parse()
Its first two arguments were non-const references that it modified.
A copy of the first was already being passed back in the returned
struct; and the one caller that wanted the modified value was in fact
copying this copy back over the QString it had passed in (that was
thus equal already). So passing by value is fine.
The second's only change was increment by a field I've just added to
StateNode in refactoring parse(); so we can let the caller do that
adding, instead.
Change-Id: I05abb644f3e5a60f94b03292302dd1bbe996cce9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetimeparser_p.h')
-rw-r--r-- | src/corelib/tools/qdatetimeparser_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h index ecacf3429c..f6f9ed5e24 100644 --- a/src/corelib/tools/qdatetimeparser_p.h +++ b/src/corelib/tools/qdatetimeparser_p.h @@ -181,7 +181,7 @@ public: }; #ifndef QT_NO_DATESTRING - StateNode parse(QString &input, int &cursorPosition, const QDateTime &defaultValue, bool fixup) const; + StateNode parse(QString input, int position, const QDateTime &defaultValue, bool fixup) const; bool fromString(const QString &text, QDate *date, QTime *time) const; #endif bool parseFormat(const QString &format); |