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

Function starunpack_helper miss a break statement #92632

Closed
zikcheng opened this issue May 10, 2022 · 1 comment · Fixed by #92655
Closed

Function starunpack_helper miss a break statement #92632

zikcheng opened this issue May 10, 2022 · 1 comment · Fixed by #92655
Assignees
Labels
easy performance

Comments

@zikcheng
Copy link
Contributor

@zikcheng zikcheng commented May 10, 2022

In function starunpack_helper, code snippet below seems to figure out whether there is a starred argument. I think it's better to insert a break statement below seen_star = 1; to stop the iteration as early as possible.

int seen_star = 0;
for (Py_ssize_t i = 0; i < n; i++) {
    expr_ty elt = asdl_seq_GET(elts, i);
    if (elt->kind == Starred_kind) {
        seen_star = 1;
    }
}
@hauntsaninja hauntsaninja added the performance label May 10, 2022
@corona10 corona10 added the easy label May 11, 2022
@corona10
Copy link
Member

@corona10 corona10 commented May 11, 2022

@zikcheng Do you want to submit the patch?

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