Setting m_payloadSize is already handled by qvariant2qobject and it is of type qint64 not int

This commit is contained in:
Erik Duisters 2019-08-20 18:44:50 +02:00
parent c22c670fee
commit f91b9e9951

View file

@ -147,7 +147,6 @@ bool NetworkPacket::unserialize(const QByteArray& a, NetworkPacket* np)
auto variant = parser.toVariant().toMap(); auto variant = parser.toVariant().toMap();
qvariant2qobject(variant, np); qvariant2qobject(variant, np);
np->m_payloadSize = variant[QStringLiteral("payloadSize")].toInt(); //Will return 0 if was not present, which is ok
if (np->m_payloadSize == -1) { if (np->m_payloadSize == -1) {
np->m_payloadSize = np->get<int>(QStringLiteral("size"), -1); np->m_payloadSize = np->get<int>(QStringLiteral("size"), -1);
} }