Skip to content

Commit 4be3c51

Browse files
authored
Merge pull request #45491 from smuzaffar/ambiguous-reversed-operator-DTSegmentCand
DTSegmentCand: Fix ambiguous-reversed-operator warning by using const operator
2 parents 1c3293f + 7a9b44f commit 4be3c51

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

RecoLocalMuon/DTSegment/src/DTSegmentCand.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ DTSegmentCand::DTSegmentCand(const AssPointCont& hits,
3434
DTSegmentCand::~DTSegmentCand() {}
3535

3636
/* Operations */
37-
bool DTSegmentCand::operator==(const DTSegmentCand& seg) {
37+
bool DTSegmentCand::operator==(const DTSegmentCand& seg) const {
3838
static const double epsilon = 0.00001;
3939
if (nHits() != seg.nHits())
4040
return false;
@@ -49,7 +49,7 @@ bool DTSegmentCand::operator==(const DTSegmentCand& seg) {
4949
return true;
5050
}
5151

52-
bool DTSegmentCand::operator<(const DTSegmentCand& seg) {
52+
bool DTSegmentCand::operator<(const DTSegmentCand& seg) const {
5353
if (nHits() == seg.nHits())
5454
return (chi2() > seg.chi2());
5555
return (nHits() < seg.nHits());

RecoLocalMuon/DTSegment/src/DTSegmentCand.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ class DTSegmentCand {
6767
virtual double t0() const { return thet0; }
6868

6969
/// equality operator based on position, direction, chi2 and nHits
70-
virtual bool operator==(const DTSegmentCand& seg);
70+
virtual bool operator==(const DTSegmentCand& seg) const;
7171

7272
/// less operator based on nHits and chi2
73-
virtual bool operator<(const DTSegmentCand& seg);
73+
virtual bool operator<(const DTSegmentCand& seg) const;
7474

7575
/// the super layer on which relies
7676
const DTSuperLayer* superLayer() const { return theSL; }

0 commit comments

Comments
 (0)