QTextLayout: Reserve space ahead of time.
We know the size, so use it instead of allowing QVector to reallocate. Change-Id: I2d18c30ef0d050326bb03c54da61459c40eb7af6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
parent
ce86d73850
commit
dbd21d0879
@ -2091,7 +2091,9 @@ static QGlyphRun glyphRunWithInfo(QFontEngine *fontEngine,
|
||||
qreal minY = 0;
|
||||
qreal maxY = 0;
|
||||
QVector<quint32> glyphs;
|
||||
glyphs.reserve(glyphsArray.size());
|
||||
QVector<QPointF> positions;
|
||||
positions.reserve(glyphsArray.size());
|
||||
for (int i=0; i<glyphsArray.size(); ++i) {
|
||||
glyphs.append(glyphsArray.at(i) & 0xffffff);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user