Port to QByteArray::max_size()

Remove the usage of the private MaxByteArraySize constant.

Change-Id: I334aaba0a93dadc9f88cf5355830e7b1880faaea
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2024-02-24 00:40:55 +01:00
parent 93a3c6b5ae
commit 5c2c831703
1 changed files with 1 additions and 2 deletions

View File

@ -21,7 +21,6 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>
#include <QtCore/private/qbytearray_p.h>
#include <QtProtobuf/private/qprotobufselfcheckiterator_p.h>
#include <QtProtobuf/private/qtprotobuflogging_p.h>
@ -455,7 +454,7 @@ public:
if (!opt)
return std::nullopt;
quint64 length = opt.value();
if (!it.isValid() || quint64(it.bytesLeft()) < length || length > quint64(MaxByteArraySize))
if (!it.isValid() || quint64(it.bytesLeft()) < length || length > quint64(QByteArray::max_size()))
return std::nullopt;
QByteArray result(it.data(), qsizetype(length));
it += length;