- /* +------------------------------------+
+/* +------------------------------------+
* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
/** Refactored by Brain, Jun 2007. Much faster with some clever O(1) array
* lookups and pointer maths.
*/
-long InspIRCd::Duration(const char* str)
+long InspIRCd::Duration(const std::string &str)
{
unsigned char multiplier = 0;
long total = 0;
long subtotal = 0;
/* Iterate each item in the string, looking for number or multiplier */
- for (const char* i = str + strlen(str) - 1; i >= str; --i)
+ for (std::string::const_reverse_iterator i = str.rbegin(); i != str.rend(); ++i)
{
/* Found a number, queue it onto the current number */
if ((*i >= '0') && (*i <= '9'))
*/
irc::commasepstream items1(parameters[splithere]);
irc::commasepstream items2(parameters[extra]);
- std::string item = "*";
+ std::string item("*");
unsigned int max = 0;
/* Attempt to iterate these lists and call the command objech
/* Only one commasepstream here */
irc::commasepstream items1(parameters[splithere]);
- std::string item = "*";
+ std::string item("*");
unsigned int max = 0;
/* Parse the commasepstream until there are no tokens remaining.
if (x->source == std::string(source))
{
cmdlist.erase(safei);
+ delete x;
}
}