Skip to content

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