diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-02-01 17:57:24 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-07 01:20:46 +0100 |
commit | a2abc11b51864ea0bab4fdb3aa44f2ec7cf0cc15 (patch) | |
tree | 303267ee1a1b228556b7519c4d337f8bc892e6dd /src/corelib/tools/qstringbuilder.h | |
parent | a78bcea5868e8986c5e024a8ca9e01314c11f4f6 (diff) |
Make QStringBuilder use memcpy for QByteArrayLiteral
There is no need to do a bytewise copy looking for the terminating
nul-character when the size of the data is statically declared and known
ahead of time.
Change-Id: I787745a58955d1a366624f9ea92e9e701de8c981
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstringbuilder.h')
-rw-r--r-- | src/corelib/tools/qstringbuilder.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index 1afdde852c..e524523c36 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -376,9 +376,8 @@ template <int N> struct QConcatenable<QStaticByteArrayDataPtr<N> > : private QAb #endif static inline void appendTo(const type &ba, char *&out) { - const char *a = ba.ptr->data; - while (*a) - *out++ = *a++; + ::memcpy(out, ba.ptr->data, N); + out += N; } }; |