diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-11-10 23:00:16 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-11-16 16:15:31 -0800 |
commit | 07ac4690c707d8552f251ce2f602c537495c07c4 (patch) | |
tree | 80a6a6967a23ea0c7c596a7948889f87ac8bd4ad /src/corelib/text/qlocale.cpp | |
parent | d50d34e5de7f5cf5e34243210e3df519974d7794 (diff) |
QLocale: make qt_doubleToAscii not have output arguments
Repeat the last commit, now for floating point parsing (and without the
benchmarking). Like the last commit, removes one category of parsing,
when we would return an advanced parsing pointer and still fail.
Change-Id: Ieba79baf5ac34264a988fffd1726759a2359828d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
-rw-r--r-- | src/corelib/text/qlocale.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 16c80dd667..97d84eac4e 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -4111,12 +4111,10 @@ double QLocaleData::stringToDouble(QStringView str, bool *ok, *ok = false; return 0.0; } - int processed = 0; - bool nonNullOk = false; - double d = qt_asciiToDouble(buff.constData(), buff.size() - 1, nonNullOk, processed); + auto r = qt_asciiToDouble(buff.constData(), buff.size() - 1); if (ok != nullptr) - *ok = nonNullOk; - return d; + *ok = r.ok(); + return r.result; } qlonglong QLocaleData::stringToLongLong(QStringView str, int base, bool *ok, |