Skip to content

Commit

Permalink
Bug correction, m_load_threshold should never be > max_size().
Browse files Browse the repository at this point in the history
  • Loading branch information
Tessil committed Jul 5, 2017
1 parent 657c9e5 commit 102d111
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ordered_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class ordered_hash: private Hash, private KeyEqual {

void max_load_factor(float ml) {
m_max_load_factor = ml;
m_load_threshold = size_type(float(bucket_count())*m_max_load_factor);
m_load_threshold = std::min(size_type(float(bucket_count())*m_max_load_factor), max_size());
}

void rehash(size_type count) {
Expand Down

0 comments on commit 102d111

Please sign in to comment.