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

replace unnecessary loop introduced in #500 with an if stmt #501

Conversation

sgreben
Copy link
Contributor

@sgreben sgreben commented Dec 21, 2023

The for loop from #500 is unnecessary. It doesn't break anything but it does cause an useless extra comparison after the first iteration if the loop is entered. This PR replaces it with an if.

I hadn't realized before that the embedded struct will never have a multi-level pointer type: you can't directly embed a **struct field and if the field is in a doubly-nested struct, that will take two recursion levels of fetchField to reach, with a *struct type each time.

@antonmedv antonmedv merged commit e7ab66a into expr-lang:master Dec 22, 2023
8 checks passed
@sgreben sgreben deleted the embedded-pointer-to-struct-field-remove-loop branch December 22, 2023 14:53
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

Successfully merging this pull request may close these issues.

2 participants