File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -676,7 +676,11 @@ struct ChainedHashTable : HashTable
676
676
/* * Sets the high watermark, i.e. the fraction of occupied entries before growing the hash table is required, to
677
677
* \p percentage. */
678
678
void set_high_watermark (double percentage) override {
679
- M_insist (percentage >= 1.0 , " using chained collisions the load factor should be at least 1" );
679
+ if (percentage < 1.0 ) {
680
+ std::cerr << " warning: using chained collisions the load factor must be in [1,∞), ignore invalid value "
681
+ << percentage << std::endl;
682
+ return ;
683
+ }
680
684
high_watermark_percentage_ = percentage;
681
685
update_high_watermark ();
682
686
}
@@ -812,7 +816,11 @@ struct OpenAddressingHashTableBase : HashTable
812
816
/* * Sets the high watermark, i.e. the fraction of occupied entries before growing the hash table is required, to
813
817
* \p percentage. */
814
818
void set_high_watermark (double percentage) override {
815
- M_insist (percentage >= 0.5 and percentage < 1.0 , " using open addressing the load factor must be in [0.5,1)" );
819
+ if (percentage < 0.5 or percentage >= 1.0 ) {
820
+ std::cerr << " warning: using open addressing the load factor must be in [0.5,1), ignore invalid value "
821
+ << percentage << std::endl;
822
+ return ;
823
+ }
816
824
high_watermark_percentage_ = percentage;
817
825
update_high_watermark ();
818
826
}
You can’t perform that action at this time.
0 commit comments