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

CppCheck: use some stl algorithms #37205

Merged
merged 5 commits into from Apr 30, 2024
Merged

CppCheck: use some stl algorithms #37205

merged 5 commits into from Apr 30, 2024

Conversation

jhaigh0
Copy link
Contributor

@jhaigh0 jhaigh0 commented Apr 24, 2024

Description of work

A bit of cppcheck suppression file pruning, in this case dealing with some of the useStlAlgorithm errors.
I got to look at a little under half of these and some I've left in because they'd just make the code much more confusing (which probably means there needs to be some refactoring really).

Hopefully all the changes I've made are for quite simple cases.

I tried to format all the lambda functions nicely but often clang has other ideas.

There is no associated issue.

To test:

  • Tests pass
  • These do need to be looked over quite carefully, I've tried to keep the functionality completely the same.

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@jhaigh0 jhaigh0 added the Maintenance Unassigned issues to be addressed in the next maintenance period. label Apr 24, 2024
@jhaigh0 jhaigh0 force-pushed the use_stl_alg_cppcheck branch 8 times, most recently from f2a750c to 7f8e062 Compare April 25, 2024 08:50
Copy link
Contributor

@robertapplin robertapplin left a comment

Choose a reason for hiding this comment

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

Code looks good, much easier to read in my opinion! Just had a few minor suggestions, and one question to make sure I don't miss something that may be a difference (but probably not)

Framework/Algorithms/src/Bin2DPowderDiffraction.cpp Outdated Show resolved Hide resolved
Framework/DataHandling/src/SaveISISNexus.cpp Outdated Show resolved Hide resolved
Framework/Geometry/src/Instrument.cpp Show resolved Hide resolved
Co-authored-by: Rob Applin <40830825+robertapplin@users.noreply.github.com>
Copy link
Contributor

@robertapplin robertapplin left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Did a code review and I can't see any differences to the old behaviour!

@SilkeSchomann SilkeSchomann merged commit 83f425f into main Apr 30, 2024
9 checks passed
@SilkeSchomann SilkeSchomann deleted the use_stl_alg_cppcheck branch April 30, 2024 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Unassigned issues to be addressed in the next maintenance period.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants