vue icon indicating copy to clipboard operation
vue copied to clipboard

In notify, why is the return not checked when subs is empty

Open lakei-edward opened this issue 1 year ago • 1 comments

Version

2.7.14

Reproduction link

github.com

Steps to reproduce

There is no

What is expected?

const subs = this.subs.filter(s => s) as DepTarget[] if (subs.length === 0) return

What is actually happening?

subs Keep running down

lakei-edward avatar May 19 '23 03:05 lakei-edward

When subs is an empty array, neither the for loop nor the sort will execute, so there is no need to check.

Alfred-Skyblue avatar Jun 12 '23 13:06 Alfred-Skyblue