Skip to content

fix -Wrange-loop-construct warnings

Paul Seyfert requested to merge pseyfert_Wrange-loop-construct into master

This is mostly replacing for (const auto element: range) by for (const auto& element: range) to avoid making a copy of the element, in place where the compiler warned about it.

In one case, and that deserves a second pair of eyes, it's an signed → unsigned int conversion (coming from a constexpr array). Mimicking the recommendation for function interfaces (yes, a loop body is not a free standing function) I kept the copy but dropped the type conversion.

The other not-anymore-copied types are const SmartRef<LHCb::MCVertex>, const std::string, and const Relations::WEntry_<unsigned int, LHCb::MCParticle, double>.

Edited by Paul Seyfert

Merge request reports