瀏覽代碼

chore(reactivity): remove unecessary array copy (#12400)

edison 1 年之前
父節點
當前提交
70b44ca835
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      packages/reactivity/src/effectScope.ts

+ 2 - 3
packages/reactivity/src/effectScope.ts

@@ -119,9 +119,8 @@ export class EffectScope {
     if (this._active) {
     if (this._active) {
       this._active = false
       this._active = false
       let i, l
       let i, l
-      const effects = this.effects.slice()
-      for (i = 0, l = effects.length; i < l; i++) {
-        effects[i].stop()
+      for (i = 0, l = this.effects.length; i < l; i++) {
+        this.effects[i].stop()
       }
       }
       this.effects.length = 0
       this.effects.length = 0