Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lakei-edward opened this issue May 19, 2023 · 1 comment
Open

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

lakei-edward opened this issue May 19, 2023 · 1 comment

Comments

@lakei-edward
Copy link

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

@Alfred-Skyblue
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants