From 03a8a981f16543b555172a3d426feac858d96576 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 9 Jul 2012 12:23:33 +0200 Subject: Use std::set instead of std::map in irc::portparser --- src/hashcomp.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/hashcomp.cpp') diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 92de37e61..3a478bb20 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -486,7 +486,6 @@ std::string& irc::stringjoiner::GetJoined() irc::portparser::portparser(const std::string &source, bool allow_overlapped) : in_range(0), range_begin(0), range_end(0), overlapped(allow_overlapped) { sep = new irc::commasepstream(source); - overlap_set.clear(); } irc::portparser::~portparser() @@ -499,13 +498,7 @@ bool irc::portparser::Overlaps(long val) if (!overlapped) return false; - if (overlap_set.find(val) == overlap_set.end()) - { - overlap_set[val] = true; - return false; - } - else - return true; + return (!overlap_set.insert(val).second); } long irc::portparser::GetToken() -- cgit v1.2.3