From afad50514b6653c1bfa767306d857f939de2eb02 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 16 Sep 2015 19:25:12 +0100 Subject: [PATCH] Simpler IdMap::operator== --- src/id_map.hh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/id_map.hh b/src/id_map.hh index 9b6f553b..e4c331de 100644 --- a/src/id_map.hh +++ b/src/id_map.hh @@ -72,14 +72,7 @@ public: template bool operator==(const IdMap& other) const { - if (size() != other.size()) - return false; - for (size_t i = 0, s = size(); i < s; ++i) - { - if (m_content[i] != other.m_content[i]) - return false; - } - return true; + return size() == other.size() and std::equal(begin(), end(), other.begin()); } template