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/qbytearray.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/qbytearray.cpp')
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 0f6e57e38b..388646f3f3 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -3982,11 +3982,9 @@ double QByteArray::toDouble(bool *ok) const auto QtPrivate::toDouble(QByteArrayView a) noexcept -> ParsedNumber<double> { - bool nonNullOk = false; - int processed = 0; - double d = qt_asciiToDouble(a.data(), a.size(), nonNullOk, processed, WhitespacesAllowed); - if (nonNullOk) - return ParsedNumber{d}; + auto r = qt_asciiToDouble(a.data(), a.size(), WhitespacesAllowed); + if (r.ok()) + return ParsedNumber{r.result}; else return {}; } |