File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,6 @@ export default class Virtual {
210
210
// return a scroll offset from given index, can efficiency be improved more here?
211
211
// although the call frequency is very high, its only a superposition of numbers
212
212
getIndexOffset ( givenIndex ) {
213
- // we know this.
214
213
if ( ! givenIndex ) {
215
214
return 0
216
215
}
@@ -220,7 +219,7 @@ export default class Virtual {
220
219
for ( let index = 0 ; index < givenIndex ; index ++ ) {
221
220
// this.__getIndexOffsetCalls++
222
221
indexSize = this . sizes . get ( this . param . uniqueIds [ index ] )
223
- offset = offset + ( indexSize || this . getEstimateSize ( ) )
222
+ offset = offset + ( typeof indexSize === 'number' ? indexSize : this . getEstimateSize ( ) )
224
223
}
225
224
226
225
// remember last calculate index
You can’t perform that action at this time.
0 commit comments