mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
QByteArray cleanup
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
7dd8809dad
commit
e7947e107b
2 changed files with 4 additions and 6 deletions
|
@ -1732,8 +1732,7 @@ static inline QByteArray &qbytearray_insert(QByteArray *ba,
|
|||
|
||||
QByteArray &QByteArray::insert(int i, const QByteArray &ba)
|
||||
{
|
||||
QByteArray copy(ba);
|
||||
return qbytearray_insert(this, i, copy.d->data, copy.d->size);
|
||||
return qbytearray_insert(this, i, ba.d->data, ba.d->size);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -1844,10 +1843,9 @@ QByteArray &QByteArray::replace(int pos, int len, const QByteArray &after)
|
|||
memmove(d->data + pos, after.d->data, len*sizeof(char));
|
||||
return *this;
|
||||
} else {
|
||||
QByteArray copy(after);
|
||||
// ### optimize me
|
||||
remove(pos, len);
|
||||
return insert(pos, copy);
|
||||
return insert(pos, after);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3889,7 +3887,7 @@ QByteArray QByteArray::fromRawData(const char *data, int size)
|
|||
|
||||
\sa fromRawData(), data(), constData()
|
||||
*/
|
||||
QByteArray &QByteArray::setRawData(const char *data, uint size)
|
||||
QByteArray &QByteArray::setRawData(const char *data, int size)
|
||||
{
|
||||
if (d->ref != 1 || d->alloc) {
|
||||
*this = fromRawData(data, size);
|
||||
|
|
|
@ -268,7 +268,7 @@ public:
|
|||
QByteArray &setNum(qulonglong, int base = 10);
|
||||
QByteArray &setNum(float, char f = 'g', int prec = 6);
|
||||
QByteArray &setNum(double, char f = 'g', int prec = 6);
|
||||
QByteArray &setRawData(const char *a, uint n); // ### Qt 5: use an int
|
||||
QByteArray &setRawData(const char *a, int n);
|
||||
|
||||
static QByteArray number(int, int base = 10);
|
||||
static QByteArray number(uint, int base = 10);
|
||||
|
|
Loading…
Add table
Reference in a new issue