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

clang-tidy: Disable readability-container-data-pointer #1047

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

chfast
Copy link
Member

@chfast chfast commented Oct 9, 2024

It may be intentional to do &v[0] instead of v.data() as a way of saying "give me the address of the 0th element" instead of "give me the address of the array of elements".

An example: #1046.

It may be intentional to do `&v[0]` instead of `v.data()` as a way of
saying "give me the address of the 0th element" instead of "give me
the address of the array of elements".

An example: #1046.
Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.21%. Comparing base (8e4a055) to head (401b579).
Report is 8 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1047   +/-   ##
=======================================
  Coverage   94.21%   94.21%           
=======================================
  Files         153      153           
  Lines       15934    15934           
=======================================
  Hits        15012    15012           
  Misses        922      922           
Flag Coverage Δ
eof_execution_spec_tests 17.53% <ø> (ø)
ethereum_tests 27.34% <ø> (ø)
ethereum_tests_silkpre 19.15% <ø> (ø)
execution_spec_tests 20.45% <ø> (ø)
unittests 89.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@gumb0
Copy link
Member

gumb0 commented Oct 9, 2024

It may be intentional to do &v[0] instead of v.data() as a way of saying "give me the address of the 0th element" instead of "give me the address of the array of elements".

do you mean just for readability, they are always equal in practice? (at least for non-empty containers)

@chfast
Copy link
Member Author

chfast commented Oct 9, 2024

It may be intentional to do &v[0] instead of v.data() as a way of saying "give me the address of the 0th element" instead of "give me the address of the array of elements".

do you mean just for readability, they are always equal in practice? (at least for non-empty containers)

Yea, readability.

2 similar comments
@chfast
Copy link
Member Author

chfast commented Oct 9, 2024

It may be intentional to do &v[0] instead of v.data() as a way of saying "give me the address of the 0th element" instead of "give me the address of the array of elements".

do you mean just for readability, they are always equal in practice? (at least for non-empty containers)

Yea, readability.

@chfast
Copy link
Member Author

chfast commented Oct 9, 2024

It may be intentional to do &v[0] instead of v.data() as a way of saying "give me the address of the 0th element" instead of "give me the address of the array of elements".

do you mean just for readability, they are always equal in practice? (at least for non-empty containers)

Yea, readability.

@chfast chfast merged commit 400f137 into master Oct 9, 2024
25 checks passed
@chfast chfast deleted the tidy/readability-container-data-pointer branch October 9, 2024 18:40
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