summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-01-29 16:44:12 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-02-01 14:13:43 +0100
commite0fda52fde32458c4a42f04bd62b5e37f14c4bfd (patch)
treedf8154a8878f767c87a5cae8ad9d1dc4e17ebffd /src/corelib/io/qprocess_unix.cpp
parent45591e13862963fb29c13e0c5bfe39330883c579 (diff)
optimization: get rid of QString::fromUtf16() usage
QString::fromUtf16() is slow - it does a BOM check and optionally byte swapping, which is utterly pointless when converting internal data structures which are raw utf16 in host byte order anyway. so replace it with QString::fromRawData() (for short-lived strings) or QString(const QChar *, int) (otherwise) if possible. Reviewed-by: axis Reviewed-by: mariusSO Reviewed-by: Bill King
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r--src/corelib/io/qprocess_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 0bf7d3f0cd..5119ec04c4 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -783,7 +783,7 @@ bool QProcessPrivate::processStarted()
// did we read an error message?
if (i > 0)
- q_func()->setErrorString(QString::fromUtf16(buf, i / sizeof(QChar)));
+ q_func()->setErrorString(QString((const QChar *)buf, i / sizeof(QChar)));
return i <= 0;
}