Skip to content

Commit 86d0d07

Browse files
committed
perf: unnecessary loop
1 parent a21e191 commit 86d0d07

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

packages/vue-virtual-scroller/src/components/RecycleScroller.vue

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -494,17 +494,8 @@ export default {
494494
495495
const continuous = startIndex <= this.$_endIndex && endIndex >= this.$_startIndex
496496
497-
if (this.$_continuous !== continuous) {
498-
if (!continuous) {
499-
views.clear()
500-
unusedViews.clear()
501-
for (let i = 0, l = pool.length; i < l; i++) {
502-
view = pool[i]
503-
this.unuseView(view)
504-
}
505-
}
506-
this.$_continuous = continuous
507-
} else if (continuous) {
497+
// Unuse views that are no longer visible
498+
if (continuous) {
508499
for (let i = 0, l = pool.length; i < l; i++) {
509500
view = pool[i]
510501
if (view.nr.used) {

0 commit comments

Comments
 (0)