summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-05-27 08:28:52 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-05-27 08:37:07 (GMT)
commitea68e4ddcf903bde74ded9d588a09863491d1d56 (patch)
tree71462281adc7be1182ee1efa6d0ddc420dc0cc6c
parent3de02411c14eb0cb57bc000cee06e90fe510c619 (diff)
downloadQt-ea68e4ddcf903bde74ded9d588a09863491d1d56.zip
Qt-ea68e4ddcf903bde74ded9d588a09863491d1d56.tar.gz
Qt-ea68e4ddcf903bde74ded9d588a09863491d1d56.tar.bz2
Replace memmove with memcpy
qMemCopy is faster than memmove, and there's no chance of overlapping source and destination memory in these cases. Reviewed-by: Samuel
-rw-r--r--src/gui/text/qstatictext.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 2889a96..84c1d96 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -439,13 +439,13 @@ namespace {
m_chars.resize(m_chars.size() + ti.num_chars);
glyph_t *glyphsDestination = m_glyphs.data() + currentItem.glyphOffset;
- memmove(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * currentItem.numGlyphs);
+ qMemCopy(glyphsDestination, glyphs.constData(), sizeof(glyph_t) * currentItem.numGlyphs);
QFixedPoint *positionsDestination = m_positions.data() + currentItem.positionOffset;
- memmove(positionsDestination, positions.constData(), sizeof(QFixedPoint) * currentItem.numGlyphs);
+ qMemCopy(positionsDestination, positions.constData(), sizeof(QFixedPoint) * currentItem.numGlyphs);
QChar *charsDestination = m_chars.data() + currentItem.charOffset;
- memmove(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars);
+ qMemCopy(charsDestination, ti.chars, sizeof(QChar) * currentItem.numChars);
m_items.append(currentItem);
}
@@ -647,13 +647,13 @@ void QStaticTextPrivate::init()
items = new QStaticTextItem[itemCount];
glyphPool = new glyph_t[glyphs.size()];
- memmove(glyphPool, glyphs.constData(), glyphs.size() * sizeof(glyph_t));
+ qMemCopy(glyphPool, glyphs.constData(), glyphs.size() * sizeof(glyph_t));
positionPool = new QFixedPoint[positions.size()];
- memmove(positionPool, positions.constData(), positions.size() * sizeof(QFixedPoint));
+ qMemCopy(positionPool, positions.constData(), positions.size() * sizeof(QFixedPoint));
charPool = new QChar[chars.size()];
- memmove(charPool, chars.constData(), chars.size() * sizeof(QChar));
+ qMemCopy(charPool, chars.constData(), chars.size() * sizeof(QChar));
for (int i=0; i<itemCount; ++i) {
items[i] = deviceItems.at(i);