summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/hashcomp.h2
-rw-r--r--src/hashcomp.cpp9
2 files changed, 2 insertions, 9 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h
index 0340cb634..36d45dc64 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -462,7 +462,7 @@ namespace irc
/** Used to determine overlapping of ports
* without O(n) algorithm being used
*/
- std::map<long, bool> overlap_set;
+ std::set<long> overlap_set;
/** Returns true if val overlaps an existing range
*/
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()