Skip to content

Commit

Permalink
perf: unnecessary loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Dec 7, 2022
1 parent a21e191 commit 86d0d07
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/vue-virtual-scroller/src/components/RecycleScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -494,17 +494,8 @@ export default {
const continuous = startIndex <= this.$_endIndex && endIndex >= this.$_startIndex
if (this.$_continuous !== continuous) {
if (!continuous) {
views.clear()
unusedViews.clear()
for (let i = 0, l = pool.length; i < l; i++) {
view = pool[i]
this.unuseView(view)
}
}
this.$_continuous = continuous
} else if (continuous) {
// Unuse views that are no longer visible
if (continuous) {
for (let i = 0, l = pool.length; i < l; i++) {
view = pool[i]
if (view.nr.used) {
Expand Down

0 comments on commit 86d0d07

Please sign in to comment.