File tree 1 file changed +1
-12
lines changed
1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ export default class Virtual {
27
27
this . sizes = new Map ( )
28
28
this . firstRangeTotalSize = 0
29
29
this . firstRangeAverageSize = 0
30
- this . lastCalcIndex = 0
31
30
this . fixedSizeValue = 0
32
31
this . calcType = CALC_TYPE . INIT
33
32
@@ -226,10 +225,6 @@ export default class Virtual {
226
225
offset = offset + ( typeof indexSize === 'number' ? indexSize : this . getEstimateSize ( ) )
227
226
}
228
227
229
- // remember last calculate index
230
- this . lastCalcIndex = Math . max ( this . lastCalcIndex , givenIndex - 1 )
231
- this . lastCalcIndex = Math . min ( this . lastCalcIndex , this . getLastIndex ( ) )
232
-
233
228
return offset
234
229
}
235
230
@@ -297,13 +292,7 @@ export default class Virtual {
297
292
return ( lastIndex - end ) * this . fixedSizeValue
298
293
}
299
294
300
- // if it's all calculated, return the exactly offset
301
- if ( this . lastCalcIndex === lastIndex ) {
302
- return this . getIndexOffset ( lastIndex ) - this . getIndexOffset ( end )
303
- } else {
304
- // if not, use a estimated value
305
- return ( lastIndex - end ) * this . getEstimateSize ( )
306
- }
295
+ return ( lastIndex - end ) * this . getEstimateSize ( )
307
296
}
308
297
309
298
// get the item estimate size
You can’t perform that action at this time.
0 commit comments