Skip to content

Commit

Permalink
sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
AJPfleger committed Sep 7, 2024
1 parent c24c589 commit 26fe6fd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
7 changes: 3 additions & 4 deletions Examples/Algorithms/Digitization/src/ModuleClusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ void ModuleClusters::merge() {

// ATTN: returns vector of index into `indices'
std::vector<std::size_t> ModuleClusters::nonGeoEntries(
std::vector<Acts::BoundIndices>& indices) {
const std::vector<Acts::BoundIndices>& indices) {
std::vector<std::size_t> retv;
for (std::size_t i = 0; i < indices.size(); i++) {
auto idx = indices.at(i);
if (!rangeContainsValue(m_geoIndices, idx)) {
if (!rangeContainsValue(m_geoIndices, indices.at(i))) {
retv.push_back(i);
}
}
Expand Down Expand Up @@ -223,7 +222,7 @@ std::vector<std::vector<ModuleValue>> ModuleClusters::mergeParameters(
return retv;
}

ModuleValue ModuleClusters::squash(std::vector<ModuleValue>& values) {
ModuleValue ModuleClusters::squash(const std::vector<ModuleValue>& values) {
ModuleValue mval;
Acts::ActsScalar tot = 0;
Acts::ActsScalar tot2 = 0;
Expand Down
7 changes: 3 additions & 4 deletions Examples/Python/src/Geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ struct MaterialSurfaceSelector {

/// @param surface is the test surface
void operator()(const Acts::Surface* surface) {
if (surface->surfaceMaterial() != nullptr) {
if (!rangeContainsValue(surfaces, surface)) {
surfaces.push_back(surface);
}
if (surface->surfaceMaterial() != nullptr &&
!rangeContainsValue(surfaces, surface)) {
surfaces.push_back(surface);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/src/Svg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ actsvg::svg::object viewDetectorVolume(const Svg::ProtoVolume& pVolume,
svgDet._id = identification;
svgDet._tag = "g";

auto [view, selection, viewRange] = viewAndRange;
const auto& [view, selection, viewRange] = viewAndRange;

// Translate selection into booleans
const bool all = rangeContainsValue(selection, "all");
Expand Down
7 changes: 3 additions & 4 deletions Plugins/Detray/src/DetrayMaterialConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ struct MaterialSurfaceSelector {

/// @param surface is the test surface
void operator()(const Acts::Surface* surface) {
if (surface->surfaceMaterial() != nullptr) {
if (!rangeContainsValue(surfaces, surface)) {
surfaces.push_back(surface);
}
if (surface->surfaceMaterial() != nullptr &&
!rangeContainsValue(surfaces, surface)) {
surfaces.push_back(surface);
}
}
};
Expand Down

0 comments on commit 26fe6fd

Please sign in to comment.