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

Added readability-container-data-pointer clang-tidy check #5588

Conversation

gnawme
Copy link
Contributor

@gnawme gnawme commented Jan 22, 2023

Added the readability-container-data-pointer check to clang-tidy to change instances where the code could use data() rather than the address of the element at index 0 in a container.

filters/src/passthrough.cpp Outdated Show resolved Hide resolved
@gnawme gnawme force-pushed the norm.evangelista/add-readability-container branch 2 times, most recently from 8223fb2 to 9dced3b Compare January 24, 2023 06:19
test/io/test_ply_mesh_io.cpp Outdated Show resolved Hide resolved
io/src/ifs_io.cpp Outdated Show resolved Hide resolved
Removed extraneous parentheses left from conversion to data()


Removed extraneous conversion to data()


Disabled clang-tidy for more Eigen::Vector4f


Fixed typo in NOLINTEND


Fixed another Eigen::Vector4f clang-tidy escape

Added more NOLINT for readability-container-data-pointer check
@gnawme gnawme force-pushed the norm.evangelista/add-readability-container branch from 9dced3b to f896110 Compare January 26, 2023 16:02
@gnawme
Copy link
Contributor Author

gnawme commented Jan 26, 2023

Tests are passing on my desktop

@larshg
Copy link
Contributor

larshg commented Jan 27, 2023

I think the approach with using .data() to get the first index and then add +1, +2, +X on subsequent usages, for ie. X,Y,Z values seems more readable, than using the &ofsomething[0/1/2] - what you think @gnawme and @mvieth ?

@gnawme
Copy link
Contributor Author

gnawme commented Jan 28, 2023

I think the approach with using .data() to get the first index and then add +1, +2, +X on subsequent usages, for ie. X,Y,Z values seems more readable, than using the &ofsomething[0/1/2] - what you think @gnawme and @mvieth ?

Makes sense to me, I hope my changes reflect your suggestion properly.

@mvieth
Copy link
Member

mvieth commented Jan 28, 2023

I think the approach with using .data() to get the first index and then add +1, +2, +X on subsequent usages, for ie. X,Y,Z values seems more readable, than using the &ofsomething[0/1/2] - what you think @gnawme and @mvieth ?

I am fine with either, as long as it is used consistently

@larshg larshg merged commit 4f5dedb into PointCloudLibrary:master Feb 1, 2023
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.

None yet

3 participants