From 6073040fa730259c3b39bf13a81e59f870d8c782 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 28 Aug 2015 15:33:28 +0100 Subject: [PATCH] Fixed 'count()' --- iflat_multimap.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iflat_multimap.h b/iflat_multimap.h index c0ccceb9..117b4cc0 100644 --- a/iflat_multimap.h +++ b/iflat_multimap.h @@ -316,8 +316,9 @@ namespace etl } else { + size_t count = std::distance(range.first, range.second); erase(range.first, range.second); - return 1; + return count; } } @@ -377,7 +378,9 @@ namespace etl //********************************************************************* size_t count(key_value_parameter_t key) const { - return (find(key == end()) ? 0 : 1); + std::pair range = equal_range(key); + + return std::distance(range.first, range.second); } //*********************************************************************