diff options
author | Robin Burchell <robin.burchell@collabora.co.uk> | 2010-07-18 21:05:44 (GMT) |
---|---|---|
committer | Andreas Kling <andreas.kling@nokia.com> | 2010-07-18 21:05:47 (GMT) |
commit | c6812138900b05012831e0f94d7d00aeac86cc2f (patch) | |
tree | 75c1fd3fbe54fbeb0b131bb71032c813ca6fd086 /src/corelib/tools | |
parent | 53d3083eecf88a20bc36ada43942c7a18677af62 (diff) | |
download | Qt-c6812138900b05012831e0f94d7d00aeac86cc2f.zip Qt-c6812138900b05012831e0f94d7d00aeac86cc2f.tar.gz Qt-c6812138900b05012831e0f94d7d00aeac86cc2f.tar.bz2 |
Remove qMemCopy() usage from all .cpp files of Qt itself.
This is (supposedly) more efficient as the compiler can optimise it to a
builtin, per Thiago.
Merge-request: 2430
Reviewed-by: Andreas Kling <andreas.kling@nokia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 6 | ||||
-rw-r--r-- | src/corelib/tools/qbytearraymatcher.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 6 | ||||
-rw-r--r-- | src/corelib/tools/qstringmatcher.cpp | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index b46af1f..a5cb16a 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -2152,18 +2152,18 @@ QByteArray QByteArray::repeated(int times) const if (result.d->alloc != resultSize) return QByteArray(); // not enough memory - qMemCopy(result.d->data, d->data, d->size); + memcpy(result.d->data, d->data, d->size); int sizeSoFar = d->size; char *end = result.d->data + sizeSoFar; const int halfResultSize = resultSize >> 1; while (sizeSoFar <= halfResultSize) { - qMemCopy(end, result.d->data, sizeSoFar); + memcpy(end, result.d->data, sizeSoFar); end += sizeSoFar; sizeSoFar <<= 1; } - qMemCopy(end, result.d->data, resultSize - sizeSoFar); + memcpy(end, result.d->data, resultSize - sizeSoFar); result.d->data[resultSize] = '\0'; result.d->size = resultSize; return result; diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp index d5a59c9..f8504f0 100644 --- a/src/corelib/tools/qbytearraymatcher.cpp +++ b/src/corelib/tools/qbytearraymatcher.cpp @@ -171,7 +171,7 @@ QByteArrayMatcher::~QByteArrayMatcher() QByteArrayMatcher &QByteArrayMatcher::operator=(const QByteArrayMatcher &other) { q_pattern = other.q_pattern; - qMemCopy(&p, &other.p, sizeof(p)); + memcpy(&p, &other.p, sizeof(p)); return *this; } diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index b2cf49b..b5651de 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6156,18 +6156,18 @@ QString QString::repeated(int times) const if (result.d->alloc != resultSize) return QString(); // not enough memory - qMemCopy(result.d->data, d->data, d->size * sizeof(ushort)); + memcpy(result.d->data, d->data, d->size * sizeof(ushort)); int sizeSoFar = d->size; ushort *end = result.d->data + sizeSoFar; const int halfResultSize = resultSize >> 1; while (sizeSoFar <= halfResultSize) { - qMemCopy(end, result.d->data, sizeSoFar * sizeof(ushort)); + memcpy(end, result.d->data, sizeSoFar * sizeof(ushort)); end += sizeSoFar; sizeSoFar <<= 1; } - qMemCopy(end, result.d->data, (resultSize - sizeSoFar) * sizeof(ushort)); + memcpy(end, result.d->data, (resultSize - sizeSoFar) * sizeof(ushort)); result.d->data[resultSize] = '\0'; result.d->size = resultSize; return result; diff --git a/src/corelib/tools/qstringmatcher.cpp b/src/corelib/tools/qstringmatcher.cpp index ff13624..80a8457 100644 --- a/src/corelib/tools/qstringmatcher.cpp +++ b/src/corelib/tools/qstringmatcher.cpp @@ -208,7 +208,7 @@ QStringMatcher &QStringMatcher::operator=(const QStringMatcher &other) if (this != &other) { q_pattern = other.q_pattern; q_cs = other.q_cs; - qMemCopy(q_data, other.q_data, sizeof(q_data)); + memcpy(q_data, other.q_data, sizeof(q_data)); } return *this; } |