diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2017-11-05 00:14:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-05 00:14:47 +0100 |
commit | efb795b59972d2ad8e7d92987ee0238ae3172d5a (patch) | |
tree | 1078389cd1e652f5402620064ef4990bd942e36b /core/ordered_hash_map.h | |
parent | 3cbcf5c2ddadf1cd630137d6bd438634b8517b00 (diff) | |
parent | 1386647cdf1c4278c4437523cc2b8be48c77351e (diff) |
Merge pull request #12630 from karroffel/configfile-orderedhashmap
make ConfigFile sections ordered
Diffstat (limited to 'core/ordered_hash_map.h')
-rw-r--r-- | core/ordered_hash_map.h | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/core/ordered_hash_map.h b/core/ordered_hash_map.h index 62eeedb437..1ed5a5d369 100644 --- a/core/ordered_hash_map.h +++ b/core/ordered_hash_map.h @@ -93,8 +93,12 @@ public: return *this; } - friend bool operator==(const Element &, const Element &); - friend bool operator!=(const Element &, const Element &); + _FORCE_INLINE_ bool operator==(const Element &p_other) const { + return this->list_element == p_other.list_element; + } + _FORCE_INLINE_ bool operator!=(const Element &p_other) const { + return this->list_element != p_other.list_element; + } operator bool() const { return (list_element != NULL); @@ -157,8 +161,12 @@ public: return ConstElement(list_element ? list_element->prev() : NULL); } - friend bool operator==(const ConstElement &, const ConstElement &); - friend bool operator!=(const ConstElement &, const ConstElement &); + _FORCE_INLINE_ bool operator==(const ConstElement &p_other) const { + return this->list_element == p_other.list_element; + } + _FORCE_INLINE_ bool operator!=(const ConstElement &p_other) const { + return this->list_element != p_other.list_element; + } operator bool() const { return (list_element != NULL); @@ -288,28 +296,4 @@ public: } }; -template <class K, class V, class Hasher, class Comparator, uint8_t MIN_HASH_TABLE_POWER, uint8_t RELATIONSHIP> -bool operator==(const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::Element &first, - const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::Element &second) { - return (first.list_element == second.list_element); -} - -template <class K, class V, class Hasher, class Comparator, uint8_t MIN_HASH_TABLE_POWER, uint8_t RELATIONSHIP> -bool operator!=(const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::Element &first, - const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::Element &second) { - return (first.list_element != second.list_element); -} - -template <class K, class V, class Hasher, class Comparator, uint8_t MIN_HASH_TABLE_POWER, uint8_t RELATIONSHIP> -bool operator==(const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::ConstElement &first, - const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::ConstElement &second) { - return (first.list_element == second.list_element); -} - -template <class K, class V, class Hasher, class Comparator, uint8_t MIN_HASH_TABLE_POWER, uint8_t RELATIONSHIP> -bool operator!=(const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::ConstElement &first, - const typename OrderedHashMap<K, V, Hasher, Comparator, MIN_HASH_TABLE_POWER, RELATIONSHIP>::ConstElement &second) { - return (first.list_element != second.list_element); -} - #endif // ORDERED_HASH_MAP_H |