Changeset 86b3ae98 in mainline
- Timestamp:
- 2018-07-05T21:41:21Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 86d1939
- Parents:
- b044f66
- git-author:
- Dzejrou <dzejrou@…> (2018-04-24 21:12:20)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/internal/hash_table.hpp
rb044f66 r86b3ae98 53 53 struct key_value_key_extractor 54 54 { 55 Key& operator()(pair<Key, Value>& p) const noexcept 56 { 57 return p.first; 58 } 59 60 const Key& operator()(pair<const Key, Value>& p) const noexcept 55 const Key& operator()(const pair<const Key, Value>& p) const noexcept 61 56 { 62 57 return p.first; … … 201 196 { 202 197 auto it = table.find(key); 203 return make_pair(it, it);198 return make_pair(it, ++it); 204 199 } 205 200 … … 211 206 { // Note: We cannot overload by return type, so we use a different name. 212 207 auto it = table.find(key); 213 return make_pair(it, it);208 return make_pair(it, ++it); 214 209 } 215 210 }; … … 705 700 using const_local_iterator = ConstLocalIterator; 706 701 702 using node_type = list_node<value_type>; 703 707 704 using hint_type = tuple< 708 705 hash_table_bucket<value_type, size_type>*, … … 1102 1099 } 1103 1100 1104 hasher hash_function() const 1105 { 1106 return hasher_; 1107 } 1108 1109 key_equal key_eq() const 1110 { 1111 return key_eq_; 1112 } 1113 1114 /* private: */ 1101 bool keys_equal(const key_type& key, const value_type& val) 1102 { 1103 return key_eq_(key, key_extractor_(val)); 1104 } 1105 1106 hash_table_bucket<value_type, size_type>* table() 1107 { 1108 return table_; 1109 } 1110 1111 hash_table_bucket<value_type, size_type>* head(size_type idx) 1112 { 1113 if (idx < bucket_count_) 1114 return &table_[idx]; 1115 else 1116 return nullptr; 1117 } 1118 1119 private: 1115 1120 hash_table_bucket<value_type, size_type>* table_; 1116 1121 size_type bucket_count_;
Note:
See TracChangeset
for help on using the changeset viewer.