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;
unsigned int i = 1;
while (true)
Jupiter::ReferenceString value;
auto config_loop_condition = [&]
{
offset = key.aformat("%u", i);
const Jupiter::ReadableString &value = Jupiter::IRC::Client::readConfigValue(key);
if (value.isEmpty()) break;
value = Jupiter::IRC::Client::readConfigValue(key);
return !value.isEmpty();
};
while (config_loop_condition())
{
key.truncate(offset);
Jupiter::IRC::Client::send(value);
i++;
}
key = "Channel.";
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);
Jupiter::IRC::Client::joinChannel(tVal);
Jupiter::IRC::Client::joinChannel(value);
i++;
}

BIN
Release/Jupiter.lib

Binary file not shown.
Loading…
Cancel
Save