projects
/
profile
/
ivi
/
qtbase.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a78bcea
)
Make QStringBuilder use memcpy for QByteArrayLiteral
author
João Abecasis
<joao.abecasis@nokia.com>
Wed, 1 Feb 2012 16:57:24 +0000
(17:57 +0100)
committer
Qt by Nokia
<qt-info@nokia.com>
Tue, 7 Feb 2012 00:20:46 +0000
(
01:20
+0100)
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>
src/corelib/tools/qstringbuilder.h
patch
|
blob
|
history
diff --git
a/src/corelib/tools/qstringbuilder.h
b/src/corelib/tools/qstringbuilder.h
index
1afdde8
..
e524523
100644
(file)
--- 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;
}
};