diff --git a/iflat_map.h b/iflat_map.h index 8b55541e..5a1bc337 100644 --- a/iflat_map.h +++ b/iflat_map.h @@ -409,7 +409,7 @@ namespace etl if (itr != end()) { - if (itr->first == key) + if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first)) { return itr; } @@ -433,7 +433,7 @@ namespace etl if (itr != end()) { - if (itr->first == key) + if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first)) { return itr; } diff --git a/iflat_multimap.h b/iflat_multimap.h index b7a18016..644f505b 100644 --- a/iflat_multimap.h +++ b/iflat_multimap.h @@ -354,7 +354,7 @@ namespace etl if (itr != end()) { - if (itr->first == key) + if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first)) { return itr; } @@ -378,7 +378,7 @@ namespace etl if (itr != end()) { - if (itr->first == key) + if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first)) { return itr; } diff --git a/iflat_multiset.h b/iflat_multiset.h index 5760583d..0f4f7efa 100644 --- a/iflat_multiset.h +++ b/iflat_multiset.h @@ -331,13 +331,13 @@ namespace etl if (itr != end()) { - if (*itr != key) + if (!key_compare()(*itr, key) && !key_compare()(key, *itr)) { - return end(); + return itr; } else { - return itr; + return end(); } } @@ -355,13 +355,13 @@ namespace etl if (itr != end()) { - if (*itr != key) + if (!key_compare()(*itr, key) && !key_compare()(key, *itr)) { - return end(); + return itr; } else { - return itr; + return end(); } } diff --git a/iflat_set.h b/iflat_set.h index b656eb33..b39d5ab9 100644 --- a/iflat_set.h +++ b/iflat_set.h @@ -338,7 +338,7 @@ namespace etl if (itr != end()) { - if (*itr == key) + if (!key_compare()(*itr, key) && !key_compare()(key, *itr)) { return itr; } @@ -362,7 +362,7 @@ namespace etl if (itr != end()) { - if (*itr == key) + if (!key_compare()(*itr, key) && !key_compare()(key, *itr)) { return itr; } diff --git a/intrusive_links.h b/intrusive_links.h index d59d81fe..2f4f4e5f 100644 --- a/intrusive_links.h +++ b/intrusive_links.h @@ -39,7 +39,7 @@ SOFTWARE. #include "error_handler.h" #undef ETL_FILE -#define ETL_FILE "21" +#define ETL_FILE "22" //***************************************************************************** // Note: diff --git a/iunordered_map.h b/iunordered_map.h index 09d0496f..b2a9e0d4 100644 --- a/iunordered_map.h +++ b/iunordered_map.h @@ -480,7 +480,7 @@ namespace etl //********************************************************************* iterator begin() { - return iterator(pbuckets->end(), first, last->begin()); + return iterator(pbuckets->end(), first, first->begin()); } //********************************************************************* @@ -489,7 +489,7 @@ namespace etl //********************************************************************* const_iterator begin() const { - return const_iterator(pbuckets->end(), first, last->begin()); + return const_iterator(pbuckets->end(), first, first->begin()); } //********************************************************************* @@ -498,7 +498,7 @@ namespace etl //********************************************************************* const_iterator cbegin() const { - return const_iterator(pbuckets->end(), first, last->begin()); + return const_iterator(pbuckets->end(), first, first->begin()); } //********************************************************************* diff --git a/test/test_map.cpp b/test/test_map.cpp index c18a2351..51abfaa4 100644 --- a/test/test_map.cpp +++ b/test/test_map.cpp @@ -807,6 +807,9 @@ namespace it = data.find("A"); CHECK_EQUAL(data.end(), it); + + it = data.find("!"); + CHECK_EQUAL(data.end(), it); } //************************************************************************* @@ -819,6 +822,9 @@ namespace it = data.find("A"); CHECK_EQUAL(data.end(), it); + + it = data.find("!"); + CHECK_EQUAL(data.end(), it); } //*************************************************************************