summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qsimplecodec.cpp
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2009-06-18 15:01:09 (GMT)
committerhjk <qtc-committer@nokia.com>2009-06-19 06:39:38 (GMT)
commit9a5b40a011bd1b15a67d83564af55011761f8ad9 (patch)
treeba99ee4cccb04c1c19512995eb26edc7638aa6ba /src/corelib/codecs/qsimplecodec.cpp
parentcce29e63108827f551c74221d0aafbbba891dd51 (diff)
downloadQt-9a5b40a011bd1b15a67d83564af55011761f8ad9.zip
Qt-9a5b40a011bd1b15a67d83564af55011761f8ad9.tar.gz
Qt-9a5b40a011bd1b15a67d83564af55011761f8ad9.tar.bz2
Small speedup of construction of uninitialized QByteArrays
Directly construct uninitialized QByteArrays of required size instead of default-constructing one and resizing it afterwards. Reviewed-by: mariusSO
Diffstat (limited to 'src/corelib/codecs/qsimplecodec.cpp')
-rw-r--r--src/corelib/codecs/qsimplecodec.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/codecs/qsimplecodec.cpp b/src/corelib/codecs/qsimplecodec.cpp
index aa7521d..0d14f67 100644
--- a/src/corelib/codecs/qsimplecodec.cpp
+++ b/src/corelib/codecs/qsimplecodec.cpp
@@ -676,8 +676,7 @@ QByteArray QSimpleTextCodec::convertFromUnicode(const QChar *in, int length, Con
delete tmp;
}
- QByteArray r;
- r.resize(length);
+ QByteArray r(length, Qt::Uninitialized);
int i = length;
int u;
const QChar* ucp = in;