@@ -87,7 +87,6 @@ export default class OpenHash extends Hash {
87
87
this . probeTypeDropDown . style . width = '132px' ;
88
88
this . probeTypeDropDown . onchange = this . checkProbeType . bind ( this ) ;
89
89
90
-
91
90
addDivisorToAlgorithmBar ( ) ;
92
91
93
92
this . hashTypeParentGroup = addGroupToAlgorithmBar ( false ) ;
@@ -96,7 +95,11 @@ export default class OpenHash extends Hash {
96
95
97
96
this . hashTypeLabel = addLabelToAlgorithmBar ( 'Hash Type:' , this . hashTypeLabelGroup ) ;
98
97
this . hashTypeDropDown = addDropDownGroupToAlgorithmBar (
99
- [ [ 'Integers' , 'Hash Integers' ] , [ 'Strings' , 'Hash Strings' ] , [ 'True' , 'True Hash Function' ] ] ,
98
+ [
99
+ [ 'Integers' , 'Hash Integers' ] ,
100
+ [ 'Strings' , 'Hash Strings' ] ,
101
+ [ 'True' , 'True Hash Function' ] ,
102
+ ] ,
100
103
'Hash Type' ,
101
104
this . hashTypedropDownGroup ,
102
105
) ;
@@ -179,7 +182,6 @@ export default class OpenHash extends Hash {
179
182
const entry = new MapEntry ( key , value ) ;
180
183
const elem = entry . elem ;
181
184
this . commands = [ ] ;
182
-
183
185
if (
184
186
( this . size + 1 ) / this . table_size > this . load_factor &&
185
187
this . table_size * 2 + 1 < MAX_SIZE
@@ -195,6 +197,8 @@ export default class OpenHash extends Hash {
195
197
196
198
if ( index === - 2 && this . table_size * 2 < MAX_SIZE ) {
197
199
this . resize ( true ) ;
200
+ index = this . doHash ( key ) ;
201
+ index = this . getEmptyIndex ( index , key ) ;
198
202
} else if ( index === - 2 ) {
199
203
this . cmd (
200
204
act . setText ,
@@ -447,8 +451,6 @@ export default class OpenHash extends Hash {
447
451
}
448
452
449
453
resize ( fromCycle ) {
450
- this . commands = [ ] ;
451
-
452
454
this . cmd ( act . setText , this . ExplainLabel , '' ) ;
453
455
this . cmd ( act . setText , this . DelIndexLabel , '' ) ;
454
456
0 commit comments