Skip to content

Commit 697cda5

Browse files
authored
Drop tautological comparison (#2502)
A pointer to a reference cannot be nullptr. If it is, whatever created the reference in the first place has already crashed. If this is to be protected, one should return the pointer and check that.
1 parent ece9f30 commit 697cda5

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Modules/MUON/MCH/src/GlobalHistogram.cxx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,6 @@ void GlobalHistogram::getDeCenterST12(int de, float& xB0, float& yB0, float& xNB
669669
}
670670

671671
const o2::mch::mapping::Segmentation& segment = o2::mch::mapping::segmentation(de);
672-
if ((&segment) == nullptr) {
673-
return;
674-
}
675672
const o2::mch::mapping::CathodeSegmentation& csegment = segment.bending();
676673
o2::mch::contour::Contour<double> envelop = o2::mch::mapping::getEnvelop(csegment);
677674
std::vector<o2::mch::contour::Vertex<double>> vertices = envelop.getVertices();
@@ -742,9 +739,6 @@ void GlobalHistogram::getDeCenterST3(int de, float& xB0, float& yB0, float& xNB0
742739
}
743740

744741
const o2::mch::mapping::Segmentation& segment = o2::mch::mapping::segmentation(de);
745-
if ((&segment) == nullptr) {
746-
return;
747-
}
748742
const o2::mch::mapping::CathodeSegmentation& csegment = segment.bending();
749743
o2::mch::contour::Contour<double> envelop = o2::mch::mapping::getEnvelop(csegment);
750744
std::vector<o2::mch::contour::Vertex<double>> vertices = envelop.getVertices();
@@ -851,9 +845,6 @@ void GlobalHistogram::getDeCenterST4(int de, float& xB0, float& yB0, float& xNB0
851845
}
852846

853847
const o2::mch::mapping::Segmentation& segment = o2::mch::mapping::segmentation(de);
854-
if ((&segment) == nullptr) {
855-
return;
856-
}
857848
const o2::mch::mapping::CathodeSegmentation& csegment = segment.bending();
858849
o2::mch::contour::Contour<double> envelop = o2::mch::mapping::getEnvelop(csegment);
859850
std::vector<o2::mch::contour::Vertex<double>> vertices = envelop.getVertices();

0 commit comments

Comments
 (0)