From c2993f666f8146e75b4039b2b7bffe3455a3ac61 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 5 Jun 2007 17:39:36 +0000 Subject: Sexeger! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7241 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/command_parse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/command_parse.cpp') diff --git a/src/command_parse.cpp b/src/command_parse.cpp index c7f89e03b..d03cb9296 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -65,7 +65,7 @@ std::string InspIRCd::TimeString(time_t curtime) /** 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; @@ -73,7 +73,7 @@ long InspIRCd::Duration(const char* str) 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')) -- cgit v1.3.1-10-gc9f91