diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-05-20 10:45:56 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-05-20 12:28:14 (GMT) |
commit | 96d10abbb40c52ac6274f1144766f3fb27dfd726 (patch) | |
tree | 538b26fd42a5d4517563958569709de023a4a052 | |
parent | d56d7f107f9d18810d742ac4d3a2e36077722cb8 (diff) | |
download | Qt-96d10abbb40c52ac6274f1144766f3fb27dfd726.zip Qt-96d10abbb40c52ac6274f1144766f3fb27dfd726.tar.gz Qt-96d10abbb40c52ac6274f1144766f3fb27dfd726.tar.bz2 |
Optimize QUuid::QUuid(const char *)
Reviewed-by: joao
-rw-r--r-- | src/corelib/plugin/quuid.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index ddc388c..e07a1aa 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -342,7 +342,15 @@ QUuid::QUuid(const QString &text) */ QUuid::QUuid(const char *text) { - *this = QUuid(QString::fromLatin1(text)); + if (!text) { + *this = QUuid(); + return; + } + + if (!_q_uuidFromHex(text, data1, data2, data3, data4)) { + *this = QUuid(); + return; + } } /*! |