Changeset 3be3752 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:
- ed9df7d
- Parents:
- 108ad4cf
- git-author:
- Dzejrou <dzejrou@…> (2018-04-25 00:36:26)
- 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
r108ad4cf r3be3752 787 787 788 788 ++size_; 789 // TODO: if we go over max load factor, rehash 789 790 rehash_if_needed(); 790 791 } 791 792 … … 802 803 803 804 ++size_; 804 // TODO: if we go over max load factor, rehash 805 806 rehash_if_needed(); 805 807 } 806 808 … … 817 819 818 820 ++size_; 819 // TODO: if we go over max load factor, rehash 821 822 rehash_if_needed(); 820 823 } 821 824 … … 1117 1120 } 1118 1121 1122 void rehash_if_needed() 1123 { 1124 if (size_ > max_load_factor_ * bucket_count_) 1125 rehash(bucket_count_ * bucket_count_growth_factor_); 1126 } 1127 1128 void increment_size() 1129 { 1130 ++size_; 1131 } 1132 1119 1133 private: 1120 1134 hash_table_bucket<value_type, size_type>* table_; … … 1126 1140 float max_load_factor_; 1127 1141 1142 static constexpr float bucket_count_growth_factor_{1.25}; 1143 1128 1144 size_type get_bucket_idx_(const key_type& key) const 1129 1145 {
Note:
See TracChangeset
for help on using the changeset viewer.