qt5base-lts/qmake
Marc Mutz 7d4bf142d7 QUuid: add fromString(QStringView/QLatin1String)
As for the formatting code, de-duplicate the parsing code by only
parsing char*s, converting QChars to Latin-1 first in a small buffer.

The QUuid(const char*) ctor performed no length checking, relying
instead on the checks performed within _q_uuidFromHex(), which
includes an implicit check for premature end (because NUL is not
a valid token for the parser).

The (QString) and (QByteArray) ctors did perform length checking.
To the extent possible, this is removed, since it is handled by
_q_uuidFromHex(). Failure cases need not be optimized. Only the
QLatin1String overload needs to do some checking, because views in
general are not NUL-terminated. The QStringView overload can just
append a NUL when it converts to Latin-1.

The only check I added to _q_uuidFromHex() is that for src ==
nullptr. It would otherwise be duplicated in several callers.

While touching the internal functions, port to passing and returning
by value.

Saves 1.6KiB in text size on optimized GCC 6.1 Linux AMD64 builds,
even though we added new API.

Port some users to the new functions. Expand fromString() test.

[ChangeLog][QtCore][QUuid] Added fromString(QStringView/QLatin1String).

Change-Id: I519339419129550c86e0ea80514865cd6a768f5d
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-20 17:02:44 +00:00
..
doc Merge remote-tracking branch 'origin/5.9' into dev 2017-04-07 10:24:33 +02:00
generators QUuid: add fromString(QStringView/QLatin1String) 2017-04-20 17:02:44 +00:00
library Merge remote-tracking branch 'origin/5.9' into dev 2017-04-20 12:31:27 +02:00
cachekeys.h Updated license headers 2016-01-21 18:55:18 +00:00
main.cpp Preserve last modification timestamps of installed program files 2017-04-13 11:33:21 +00:00
Makefile.unix qmake: Add test functions for comparing version numbers 2017-03-20 21:56:01 +00:00
Makefile.unix.macos Merge remote-tracking branch 'origin/5.8' into dev 2016-12-13 09:39:20 +01:00
Makefile.unix.mingw configure: put more of the makefile contents into template files 2016-11-23 09:38:14 +00:00
Makefile.unix.unix configure: put more of the makefile contents into template files 2016-11-23 09:38:14 +00:00
Makefile.unix.win32 Merge remote-tracking branch 'origin/5.8' into dev 2017-01-25 20:06:06 +01:00
Makefile.win32 Merge remote-tracking branch 'origin/5.9' into dev 2017-03-28 09:28:31 +02:00
meta.cpp qmake: eradicate Q_FOREACH loops [needing qAsConst()] 2016-01-28 20:25:18 +00:00
meta.h Updated license headers 2016-01-21 18:55:18 +00:00
option.cpp qmake: Do not mix canonical and non canonical paths 2017-04-11 05:37:52 +00:00
option.h bump qmake version 2016-11-15 22:43:51 +00:00
project.cpp qmake: use new QString::arg(QStringView) overload 2017-04-07 18:33:23 +00:00
project.h Merge remote-tracking branch 'origin/5.7' into dev 2016-07-19 20:14:40 +02:00
property.cpp move generation of qconfig.cpp (and qt.conf) to qmake-based configure 2016-12-13 18:56:12 +00:00
property.h move generation of qconfig.cpp (and qt.conf) to qmake-based configure 2016-12-13 18:56:12 +00:00
qmake_pch.h Updated license headers 2016-01-21 18:55:18 +00:00
qmake-aux.pro revert to building qmake with qconfig.cpp 2017-01-06 20:09:08 +00:00
qmake.pri qmake: Add test functions for comparing version numbers 2017-03-20 21:56:01 +00:00
qmake.pro configure: delete some dead code and outdated comments 2016-11-23 09:38:09 +00:00