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>
bb10
João Abecasis 2012-02-01 17:57:24 +01:00 committed by Qt by Nokia
parent a78bcea586
commit a2abc11b51
1 changed files with 2 additions and 3 deletions

View File

@ -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;
}
};