diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-07-11 14:40:43 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-07-11 15:01:31 +0200 |
commit | a8d911c021c92d424882003cf22cf4e154ec5ea2 (patch) | |
tree | 6ca29dc705bdc7b9790c5f4d5db35642ecb847b8 /src/hashcomp.cpp | |
parent | 03a8a981f16543b555172a3d426feac858d96576 (diff) |
Don't manage memory manually for the commasepstream in irc::portparser
Diffstat (limited to 'src/hashcomp.cpp')
-rw-r--r-- | src/hashcomp.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 3a478bb20..2275a1006 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -483,14 +483,9 @@ std::string& irc::stringjoiner::GetJoined() return joined; } -irc::portparser::portparser(const std::string &source, bool allow_overlapped) : in_range(0), range_begin(0), range_end(0), overlapped(allow_overlapped) +irc::portparser::portparser(const std::string &source, bool allow_overlapped) + : sep(source), in_range(0), range_begin(0), range_end(0), overlapped(allow_overlapped) { - sep = new irc::commasepstream(source); -} - -irc::portparser::~portparser() -{ - delete sep; } bool irc::portparser::Overlaps(long val) @@ -526,14 +521,14 @@ long irc::portparser::GetToken() } std::string x; - sep->GetToken(x); + sep.GetToken(x); if (x.empty()) return 0; while (Overlaps(atoi(x.c_str()))) { - if (!sep->GetToken(x)) + if (!sep.GetToken(x)) return 0; } |