Skip to content

reflect: rawFieldByNameFunc: copy index slice to avoid later overwrites #4367

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

Closed

Conversation

dgryski
Copy link
Member

@dgryski dgryski commented Jul 26, 2024

No description provided.

@lpereira
Copy link
Contributor

In #4287, there's a commit implementing FieldByNameFunc() in terms of VisibleFields() (and implementing FieldByName() interms of FieldByNameFunc()). It removes over 120 lines of code, simplifying the code quite a bit. Is there any downside is using that version of the code instead?

@dgryski
Copy link
Member Author

dgryski commented Jul 26, 2024

Because FieldByName is able to short-circuit walking the struct while VisibileFields necessarily needs to process every single field.

@lpereira
Copy link
Contributor

Ah, makes sense. Yeah, we can clean that up later. I'm rebasing #4287 on this patch then.

@dgryski dgryski marked this pull request as ready for review July 27, 2024 02:12
@dgryski dgryski self-assigned this Jul 31, 2024
@dgryski dgryski requested a review from aykevl July 31, 2024 18:41
@dgryski
Copy link
Member Author

dgryski commented Jul 31, 2024

Commit merged as part of #4287

@dgryski dgryski closed this Jul 31, 2024
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