Skip to content

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

Open

Description

@lakei-edward

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

Activity

  1. Alfred-Skyblue commented on Jun 12, 2023

    @Alfred-Skyblue
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions