diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2023-02-03 00:18:05 +0200 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-02-07 20:04:11 +0200 |
| commit | 27db859c6a36738d5074f59584ba7d2b289d1ae4 (patch) | |
| tree | 4ba87eef451306062bd52d149d675eed96cfad7a /src/corelib/serialization/qtextstream.cpp | |
| parent | 498f3452285aa44580e1d03baeec126d475f8401 (diff) | |
Use QtMiscUtils hex/oct-related helpers
Thanks to Thiago for pointing them out in review.
Change-Id: I14d588a8bd5ba29d43a5daeacfd55d974eb65557
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qtextstream.cpp')
| -rw-r--r-- | src/corelib/serialization/qtextstream.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index 806616aaf4e..c02effb1655 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -1752,13 +1752,10 @@ QTextStreamPrivate::NumberParsingStatus QTextStreamPrivate::getNumber(qulonglong // Parse digits int ndigits = 0; while (getChar(&dig)) { - int n = dig.toLower().unicode(); - if (n >= '0' && n <= '9') { - val <<= 4; - val += n - '0'; - } else if (n >= 'a' && n <= 'f') { + const int h = fromHex(dig.unicode()); + if (h != -1) { val <<= 4; - val += 10 + (n - 'a'); + val += h; } else { ungetChar(dig); break; |
