File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Expand file tree Collapse file tree 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 {
2727 this . sizes = new Map ( )
2828 this . firstRangeTotalSize = 0
2929 this . firstRangeAverageSize = 0
30- this . lastCalcIndex = 0
3130 this . fixedSizeValue = 0
3231 this . calcType = CALC_TYPE . INIT
3332
@@ -226,10 +225,6 @@ export default class Virtual {
226225 offset = offset + ( typeof indexSize === 'number' ? indexSize : this . getEstimateSize ( ) )
227226 }
228227
229- // remember last calculate index
230- this . lastCalcIndex = Math . max ( this . lastCalcIndex , givenIndex - 1 )
231- this . lastCalcIndex = Math . min ( this . lastCalcIndex , this . getLastIndex ( ) )
232-
233228 return offset
234229 }
235230
@@ -297,13 +292,7 @@ export default class Virtual {
297292 return ( lastIndex - end ) * this . fixedSizeValue
298293 }
299294
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 ( )
307296 }
308297
309298 // get the item estimate size
You can’t perform that action at this time.
0 commit comments