diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-16 02:09:58 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-16 02:09:58 +0000 |
commit | ef10f984fa75c3197ec2515418e1b180fdbfc390 (patch) | |
tree | 7edd90390773d9ff0e76298abcfbef2d7a2b782b /include | |
parent | 6ab0b94dceb7d7f0bfca39976e745f22c7ba8939 (diff) |
This should be faster, we read it like a stream now with GetToken until GetToken returns "".
The optimizations done by gcc means theres only one std::string constructor call per token, which is mmm yum.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4397 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/hashcomp.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h index ad6a2133e..b818b16f5 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -82,14 +82,15 @@ namespace irc class tokenstream { private: - std::string tokenbuffer; - std::vector<std::string> tokens; + std::string tokens; + std::string::iterator last_starting_position; + std::string::iterator n; + bool last_pushed; public: tokenstream(std::string &source); ~tokenstream(); - unsigned int GetNumTokens(); - const std::string& GetToken(unsigned int index); + const std::string GetToken(); }; |