diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-05 17:39:36 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-05 17:39:36 +0000 |
commit | c2993f666f8146e75b4039b2b7bffe3455a3ac61 (patch) | |
tree | 9672e7a956f241696a337acf9973309c4c2b1e16 /src/command_parse.cpp | |
parent | d2717df5ef65c00bb43e1b775c7846af1625848a (diff) |
Sexeger!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7241 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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')) |