Skip to content

[PWGLF] Use const& and std::move to avoid copies - #17711

Open
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:const-PWGLF
Open

[PWGLF] Use const& and std::move to avoid copies#17711
vkucera wants to merge 1 commit into
AliceO2Group:masterfrom
vkucera:const-PWGLF

Conversation

@vkucera

@vkucera vkucera commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Mostly done automatically by Clang-Tidy.

Mostly done automatically by Clang-Tidy.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 2701 errors, ⚠️ 2095 warnings, 🔕 7 disabled

@github-actions github-actions Bot added the pwglf label Sep 1, 2026
@github-actions github-actions Bot changed the title Use const& and std::move to avoid copies [PWGLF] Use const& and std::move to avoid copies Sep 1, 2026
@vkucera
vkucera marked this pull request as ready for review September 1, 2026 15:54
@romainschotter
romainschotter enabled auto-merge (squash) September 1, 2026 19:31
@alibuild

alibuild commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 1ca779b at 2026-09-03 21:58:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 526 errors and 4094 warnings.'
Found 526 errors and 4094 warnings.
++ [[ 526 -gt 0 ]]
++ cat /sw/BUILD/862e6d91a891848d0bb88d70ff4bafe70c0aae51/O2Physics-code-check/errors.txt
PWGLF/TableProducer/Common/epvector.cxx:62:8: error: constructor does not initialize these fields: ccdb, offsetFT0, offsetFV0, gainprofile, hrecentere, shiftprofile, shiftprofile2, shiftprofile3, shiftprofile4, shiftprofile5 [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:195:7: error: variable 'pidCuts' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:199:22: error: variable 'hNsigma' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:200:22: error: variable 'hTOFmass' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:201:22: error: variable 'hGenNuclei' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:202:22: error: variable 'hMomRes' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:203:22: error: variable 'hNsigmaEta' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:204:22: error: variable 'hTOFmassEta' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:205:22: error: variable 'hDCAxy' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:206:22: error: variable 'hDCAz' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:207:22: error: variable 'hGloTOFtracks' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:208:22: error: variable 'hDeltaP' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:209:28: error: variable 'hDCAHists' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:210:27: error: variable 'lut' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:210:27: error: variable 'lut' provides global access to a non-const object; consider making the pointed-to data 'const' [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:212:31: error: variable 'candidates' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:250:8: error: constructor does not initialize these fields: ccdb, pdgDB [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:277:58: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:289:70: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:296:77: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:299:100: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:300:82: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:301:72: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:302:67: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:304:63: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:802:7: error: uninitialized record type: 'nSigmaTPC' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx:823:7: error: uninitialized record type: 'dcaInfo' [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:80:34: error: variable 'metadataInfo' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:201:3: error: constructor does not initialize these fields: betheParams, trkSettings [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:10: error: std::move of the const variable 'name_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:28: error: std::move of the const variable 'daughters_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:51: error: std::move of the const variable 'daughterTrackSigns_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:225:83: error: std::move of the const variable 'v0DaughterVec_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:233:10: error: std::move of the const variable 'name_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:233:28: error: std::move of the const variable 'daughters_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:233:51: error: std::move of the const variable 'daughterTrackSigns_' has no effect; remove std::move() or make the variable non-const [performance-move-const-arg,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:256:30: error: Address of stack memory associated with temporary object of type 'TString' returned to caller [clang-analyzer-core.StackAddressEscape,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:257:33: error: Address of stack memory associated with temporary object of type 'TString' returned to caller [clang-analyzer-core.StackAddressEscape,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:268:3: error: constructor does not initialize these fields: dcaToPv, dcaToPvXY, dcaToPvZ, active [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:486:5: error: 'itBegin' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:508:35: error: variable 'hDeDx' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
PWGLF/TableProducer/Nuspex/hypKfRecoTask.cxx:509:35: error: variable 'hInvMass' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables,-warnings-as-errors]
[0 more errors; see full log]

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants