Changeset e912cdf in mainline for uspace/lib/cpp/include/internal
- 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:
- 5ae8168
- Parents:
- ed9df7d
- git-author:
- Dzejrou <dzejrou@…> (2018-04-25 16:45:01)
- 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
red9df7d re912cdf 1002 1002 void max_load_factor(float factor) 1003 1003 { 1004 /** 1005 * Note: According to the standard, this function 1006 * can have no effect. 1007 */ 1008 // TODO: change max factor and rehash if needed 1004 if (factor > 0.f) 1005 max_load_factor_ = factor; 1006 1007 rehash_if_needed(); 1009 1008 } 1010 1009 … … 1081 1080 } 1082 1081 1083 void set_hint(const_iterator hint)1084 {1085 // TODO: hint_ should be a ptr and we extract it here,1086 // then set it to nullptr after each operation1087 }1088 1089 1082 hint_type find_insertion_spot(const key_type& key) 1090 1083 { … … 1129 1122 { 1130 1123 ++size_; 1124 1125 rehash_if_needed(); 1126 } 1127 1128 void decrement_size() 1129 { 1130 --size_; 1131 } 1132 1133 node_type* find_node_or_return_head(const key_type& key, 1134 const hash_table_bucket<value_type, size_type>& bucket) 1135 { 1136 if (bucket.head) 1137 { 1138 auto head = bucket.head; 1139 auto current = bucket.head; 1140 1141 do 1142 { 1143 if (keys_equal(key, current->value)) 1144 return current; 1145 else 1146 current = current->next; 1147 } 1148 while (current != head); 1149 1150 return head; 1151 } 1152 else 1153 return nullptr; 1131 1154 } 1132 1155
Note:
See TracChangeset
for help on using the changeset viewer.