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

Try to appease clang #74740

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Conversation

ehughsbaird
Copy link
Contributor

@ehughsbaird ehughsbaird commented Jun 23, 2024

Summary

None

Purpose of change

Clang-tidy keeps making this suggestion in my PR: https://github.com/CleverRaven/Cataclysm-DDA/actions/runs/9634796206/job/26570985402?pr=74700#step:9:913

Error: /home/runner/work/Cataclysm-DDA/Cataclysm-DDA/src/map.cpp:5248:82: error: the parameter 'obj' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
 5248 | std::pair<item *, tripoint> map::_add_item_or_charges( const tripoint &pos, item obj,
      |                                                                                  ^
      |                                                                             const  &

This doesn't compile.

Describe the solution

Silence the clang-tidy check.

Testing

Watch the clang-tidy run on this PR.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jun 23, 2024
src/map.h Outdated Show resolved Hide resolved
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions and removed astyled astyled PR, label is assigned by github actions labels Jun 24, 2024
@Maleclypse Maleclypse merged commit 8b7f1de into CleverRaven:master Jun 25, 2024
28 checks passed
@ehughsbaird ehughsbaird deleted the try-appease-clang branch June 25, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants