Codechange: Use Recv/Send_bytes for md5sum. (#12602)

Use existing functions to handle serialisation of arrays instead of indexed for-loop.
This commit is contained in:
Peter Nelson
2024-05-01 18:55:54 +01:00
committed by GitHub
parent 1424a184d8
commit 532ce1a907
2 changed files with 4 additions and 13 deletions
+2 -6
View File
@@ -375,9 +375,7 @@ void DeserializeNetworkGameInfo(Packet &p, NetworkGameInfo &info, const GameInfo
void SerializeGRFIdentifier(Packet &p, const GRFIdentifier &grf)
{
p.Send_uint32(grf.grfid);
for (size_t j = 0; j < grf.md5sum.size(); j++) {
p.Send_uint8(grf.md5sum[j]);
}
p.Send_bytes(grf.md5sum);
}
/**
@@ -388,9 +386,7 @@ void SerializeGRFIdentifier(Packet &p, const GRFIdentifier &grf)
void DeserializeGRFIdentifier(Packet &p, GRFIdentifier &grf)
{
grf.grfid = p.Recv_uint32();
for (size_t j = 0; j < grf.md5sum.size(); j++) {
grf.md5sum[j] = p.Recv_uint8();
}
p.Recv_bytes(grf.md5sum);
}
/**