Skip to content

Commit 7b6eb97

Browse files
committed
readability-container-contains
1 parent 801481f commit 7b6eb97

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ struct TableMakerMC {
612612
}
613613

614614
// If this MC track was not already added to the map, add it now
615-
if (fLabelsMap.find(mctrack.globalIndex()) == fLabelsMap.end()) {
615+
if (!fLabelsMap.contains(mctrack.globalIndex())) {
616616
fLabelsMap[mctrack.globalIndex()] = trackCounter;
617617
fLabelsMapReversed[trackCounter] = mctrack.globalIndex();
618618
fMCFlags[mctrack.globalIndex()] = mcflags;
@@ -1454,7 +1454,7 @@ struct TableMakerMC {
14541454
if (mctrack.has_mothers()) {
14551455
for (auto& m : mctrack.mothersIds()) {
14561456
if (m < mcParticles.size()) { // protect against bad mother indices
1457-
if (fLabelsMap.find(m) != fLabelsMap.end()) {
1457+
if (fLabelsMap.contains(m)) {
14581458
mothers.push_back(fLabelsMap.find(m)->second);
14591459
}
14601460
} else {
@@ -1471,7 +1471,7 @@ struct TableMakerMC {
14711471
for (int d = mctrack.daughtersIds()[0]; d <= mctrack.daughtersIds()[1]; ++d) {
14721472
// TODO: remove this check as soon as issues with MC production are fixed
14731473
if (d < mcParticles.size()) { // protect against bad daughter indices
1474-
if (fLabelsMap.find(d) != fLabelsMap.end()) {
1474+
if (fLabelsMap.contains(d)) {
14751475
daughters.push_back(fLabelsMap.find(d)->second);
14761476
}
14771477
} else {

PWGDQ/TableProducer/tableMaker_withAssoc.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ struct TableMaker {
757757
oVtxZ[collision.globalIndex()] = collision.posZ();
758758

759759
// if more than one collision per bunch, add that collision to the list for that bunch
760-
if (oBCreversed.find(bc) == oBCreversed.end()) {
760+
if (!oBCreversed.contains(bc)) {
761761
std::vector<int64_t> evs = {collision.globalIndex()};
762762
oBCreversed[bc] = evs;
763763
} else {
@@ -1449,7 +1449,7 @@ struct TableMaker {
14491449
}
14501450

14511451
// write the MFT track global index in the map for skimming (to make sure we have it just once)
1452-
if (fMftIndexMap.find(track.globalIndex()) == fMftIndexMap.end()) {
1452+
if (!fMftIndexMap.contains(track.globalIndex())) {
14531453
uint32_t reducedEventIdx = fCollIndexMap[collision.globalIndex()];
14541454
outTables.mftTrack(reducedEventIdx, static_cast<uint64_t>(0), track.pt(), track.eta(), track.phi());
14551455
// TODO: We are not writing the DCA at the moment, because this depend on the collision association

0 commit comments

Comments
 (0)