From 2c25d4a34428088b9407be14740041346500eb5f Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 15 Oct 2007 22:07:32 +0000 Subject: Fuck. Press save, then commit. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8212 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 462b50d88..9a525dd5b 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -59,49 +59,6 @@ std::string InspIRCd::TimeString(time_t curtime) return std::string(ctime(&curtime),24); } -/** Refactored by Brain, Jun 2007. Much faster with some clever O(1) array - * lookups and pointer maths. - */ -long InspIRCd::Duration(const std::string &str) -{ - unsigned char multiplier = 0; - long total = 0; - long times = 1; - long subtotal = 0; - - /* Iterate each item in the string, looking for number or multiplier */ - 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')) - { - subtotal = subtotal + ((*i - '0') * times); - times = times * 10; - } - else - { - /* Found something thats not a number, find out how much - * it multiplies the built up number by, multiply the total - * and reset the built up number. - */ - if (subtotal) - total += subtotal * duration_multi[multiplier]; - - /* Next subtotal please */ - subtotal = 0; - multiplier = *i; - times = 1; - } - } - if (multiplier) - { - total += subtotal * duration_multi[multiplier]; - subtotal = 0; - } - /* Any trailing values built up are treated as raw seconds */ - return total + subtotal; -} - /* LoopCall is used to call a command classes handler repeatedly based on the contents of a comma seperated list. * There are two overriden versions of this method, one of which takes two potential lists and the other takes one. * We need a version which takes two potential lists for JOIN, because a JOIN may contain two lists of items at once, -- cgit v1.2.3