Improve containsIndex

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-08-11 12:30:38 +05:30 committed by Bruno Windels
parent 3ae52ea1ca
commit e10b494f0c

View file

@ -43,9 +43,7 @@ class ItemRange {
}
containsIndex(idx) {
// TODO: Replace by lastIndex
// TODO: Should idx be <= since lastIndex is not rendered?
return idx >= this.topCount && idx <= (this.topCount + this.renderCount);
return idx >= this.topCount && idx < this.lastIndex;
}
expand(amount) {