Port QByteDataBuffer to qsizetype

Less impedance mismatch with the other Qt containers.

As a drive-by, fix code style in the touched lines, and remove
superfluous inline keywords.

Pick-to: 6.4 6.3
Change-Id: I2c9444a8f956e58c361104a19f55fcc783cd1a1d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Marc Mutz 2022-07-18 09:05:18 +02:00
parent 440f91bd0d
commit ce2ba5d59d
2 changed files with 4 additions and 4 deletions

View File

@ -229,7 +229,7 @@ public:
} }
// the number of QByteArrays // the number of QByteArrays
inline int bufferCount() const qsizetype bufferCount() const
{ {
return buffers.length(); return buffers.length();
} }
@ -247,7 +247,7 @@ public:
return buffers.first().size() - firstPos; return buffers.first().size() - firstPos;
} }
inline QByteArray& operator[](int i) QByteArray &operator[](qsizetype i)
{ {
if (i == 0) if (i == 0)
squeezeFirst(); squeezeFirst();
@ -256,7 +256,7 @@ public:
} }
inline bool canReadLine() const { inline bool canReadLine() const {
int i = 0; qsizetype i = 0;
if (i < buffers.length()) { if (i < buffers.length()) {
if (buffers.at(i).indexOf('\n', firstPos) != -1) if (buffers.at(i).indexOf('\n', firstPos) != -1)
return true; return true;

View File

@ -458,7 +458,7 @@ void QNetworkReplyImplPrivate::appendDownstreamData(QByteDataBuffer &data)
} }
qint64 bytesWritten = 0; qint64 bytesWritten = 0;
for (int i = 0; i < data.bufferCount(); i++) { for (qsizetype i = 0; i < data.bufferCount(); ++i) {
QByteArray const &item = data[i]; QByteArray const &item = data[i];
if (cacheSaveDevice) if (cacheSaveDevice)