forked from teamnwah/openmw-tes3coop
[Client] Simplify loops
This commit is contained in:
parent
f7341c021f
commit
7d3e08f031
1 changed files with 7 additions and 8 deletions
|
@ -116,13 +116,13 @@ string comparePluginsMonospaced(PacketPreInit::PluginContainer checksums, Packet
|
||||||
std::ostringstream sstr;
|
std::ostringstream sstr;
|
||||||
size_t pluginNameLen1 = 0;
|
size_t pluginNameLen1 = 0;
|
||||||
size_t pluginNameLen2 = 0;
|
size_t pluginNameLen2 = 0;
|
||||||
for (size_t i = 0; i < checksums.size(); i++)
|
for (const auto &checksum : checksums)
|
||||||
if (pluginNameLen1 < checksums[i].first.size())
|
if (pluginNameLen1 < checksum.first.size())
|
||||||
pluginNameLen1 = checksums[i].first.size();
|
pluginNameLen1 = checksum.first.size();
|
||||||
|
|
||||||
for (size_t i = 0; i < checksumsResponse.size(); i++)
|
for (const auto &checksum : checksums)
|
||||||
if (pluginNameLen2 < checksumsResponse[i].first.size())
|
if (pluginNameLen2 < checksum.first.size())
|
||||||
pluginNameLen2 = checksumsResponse[i].first.size();
|
pluginNameLen2 = checksum.first.size();
|
||||||
|
|
||||||
sstr << "Your plugins or their load order don't match the server's.\n\n";
|
sstr << "Your plugins or their load order don't match the server's.\n\n";
|
||||||
Utils::printWithWidth(sstr, "Your current plugins are:", pluginNameLen1 + 16);
|
Utils::printWithWidth(sstr, "Your current plugins are:", pluginNameLen1 + 16);
|
||||||
|
@ -259,8 +259,7 @@ void Networking::connect(const std::string &ip, unsigned short port, std::vector
|
||||||
bool queue = true;
|
bool queue = true;
|
||||||
while (queue)
|
while (queue)
|
||||||
{
|
{
|
||||||
for (RakNet::Packet *packet = peer->Receive(); packet; peer->DeallocatePacket(
|
for (RakNet::Packet *packet = peer->Receive(); packet; peer->DeallocatePacket(packet), packet = peer->Receive())
|
||||||
packet), packet = peer->Receive())
|
|
||||||
{
|
{
|
||||||
switch (packet->data[0])
|
switch (packet->data[0])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue