Skip to content

fix: remove superfluous struct field index compare#970

Open
Willem-J-an wants to merge 1 commit into
apache:mainfrom
Willem-J-an:main
Open

fix: remove superfluous struct field index compare#970
Willem-J-an wants to merge 1 commit into
apache:mainfrom
Willem-J-an:main

Conversation

@Willem-J-an

Copy link
Copy Markdown
Contributor

What changes are included in this PR?

Remove superfluous check in the TypeEqual path to improve performance

Rationale for this change

The check is superfluous because:

  • Length is verified to equal
  • Next step iterates over fields & asserts the names are equal for each index. These 2 steps essentially check the same thing, without needing expensive DeepEqual of 2 maps.

Are these changes tested?

passes on go test -v ./arrow

Are there any user-facing changes?

No

@Willem-J-an
Willem-J-an requested a review from zeroshade as a code owner July 21, 2026 12:35

@zeroshade zeroshade left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this

Comment thread arrow/compare.go Outdated
The check is superfluous because:
- Length is verified to equal
- Next step iterates over fields & asserts the names are equal for each
  index.
These 2 steps essentially check the same thing,
 without needing expensive DeepEqual of 2 maps.
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