Browse Source

Now using a lambda as the config loop condition instead of breaking.

release/0.19
JustinAJ 10 years ago
parent
commit
855068de5a
  1. 17
      Jupiter/IRC_Client.cpp
  2. BIN
      Release/Jupiter.lib

17
Jupiter/IRC_Client.cpp

@ -856,24 +856,25 @@ int Jupiter::IRC::Client::primaryHandler()
size_t offset; size_t offset;
unsigned int i = 1; unsigned int i = 1;
while (true) Jupiter::ReferenceString value;
auto config_loop_condition = [&]
{ {
offset = key.aformat("%u", i); offset = key.aformat("%u", i);
const Jupiter::ReadableString &value = Jupiter::IRC::Client::readConfigValue(key); value = Jupiter::IRC::Client::readConfigValue(key);
if (value.isEmpty()) break; return !value.isEmpty();
};
while (config_loop_condition())
{
key.truncate(offset); key.truncate(offset);
Jupiter::IRC::Client::send(value); Jupiter::IRC::Client::send(value);
i++; i++;
} }
key = "Channel."; key = "Channel.";
i = 1; i = 1;
while (true) while (config_loop_condition())
{ {
offset = key.aformat("%u", i);
const Jupiter::ReadableString &tVal = Jupiter::IRC::Client::readConfigValue(key);
if (tVal.isEmpty()) break;
key.truncate(offset); key.truncate(offset);
Jupiter::IRC::Client::joinChannel(tVal); Jupiter::IRC::Client::joinChannel(value);
i++; i++;
} }

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save