mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
avoid QByteArray resizing
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
60c9244dad
commit
0658cffbae
3 changed files with 4 additions and 9 deletions
|
@ -2822,8 +2822,7 @@ QByteArray QDeclarativeBindingCompilerPrivate::buildSignalTable() const
|
||||||
|
|
||||||
QByteArray QDeclarativeBindingCompilerPrivate::buildExceptionData() const
|
QByteArray QDeclarativeBindingCompilerPrivate::buildExceptionData() const
|
||||||
{
|
{
|
||||||
QByteArray rv;
|
QByteArray rv(committed.exceptions.count() * sizeof(quint64), Qt::Uninitialized);
|
||||||
rv.resize(committed.exceptions.count() * sizeof(quint64));
|
|
||||||
::memcpy(rv.data(), committed.exceptions.constData(), rv.size());
|
::memcpy(rv.data(), committed.exceptions.constData(), rv.size());
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1384,11 +1384,8 @@ QByteArray QMetaObjectBuilder::toRelocatableData(bool *ok) const
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray data;
|
QByteArray data(size, '\0');
|
||||||
data.resize(size);
|
buildMetaObject(d, data.data(), true);
|
||||||
char *buf = data.data();
|
|
||||||
memset(buf, 0, size);
|
|
||||||
buildMetaObject(d, buf, true);
|
|
||||||
if (ok) *ok = true;
|
if (ok) *ok = true;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -745,8 +745,7 @@ QByteArray QDeclarativeListModelParser::compile(const QList<QDeclarativeCustomPa
|
||||||
instr.count() * sizeof(ListInstruction) +
|
instr.count() * sizeof(ListInstruction) +
|
||||||
data.count();
|
data.count();
|
||||||
|
|
||||||
QByteArray rv;
|
QByteArray rv(size, Qt::Uninitialized);
|
||||||
rv.resize(size);
|
|
||||||
|
|
||||||
ListModelData *lmd = (ListModelData *)rv.data();
|
ListModelData *lmd = (ListModelData *)rv.data();
|
||||||
lmd->dataOffset = sizeof(ListModelData) +
|
lmd->dataOffset = sizeof(ListModelData) +
|
||||||
|
|
Loading…
Add table
Reference in a new issue