diff --git a/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx b/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx index 8eaf5e700cf60..2c40c62fccc4c 100644 --- a/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx +++ b/Detectors/ITSMFT/common/simulation/src/Digitizer.cxx @@ -461,20 +461,20 @@ void Digitizer::registerDigits(ChipDigitsContainer& chip, uint32_t roFrame, floa continue; } ExtraDig* extra = getExtraDigBuffer(roFr); - int& nxt = pd->labelRef.next; + int* nxt = &pd->labelRef.next; bool skip = false; - while (nxt >= 0) { - if ((*extra)[nxt].label == lbl) { // don't store the same label twice + while (*nxt >= 0) { + if ((*extra)[*nxt].label == lbl) { // don't store the same label twice skip = true; break; } - nxt = (*extra)[nxt].next; + nxt = &(*extra)[*nxt].next; } if (skip) { continue; } // new predigit will be added in the end of the chain - nxt = extra->size(); + *nxt = extra->size(); extra->emplace_back(lbl); } } diff --git a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx index d07fb53b7220e..fd17641d20154 100644 --- a/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ITS3/simulation/src/Digitizer.cxx @@ -457,20 +457,20 @@ void Digitizer::registerDigits(o2::its3::ChipDigitsContainer& chip, uint32_t roF continue; } ExtraDig* extra = getExtraDigBuffer(roFr); - int& nxt = pd->labelRef.next; + int* nxt = &pd->labelRef.next; bool skip = false; - while (nxt >= 0) { - if ((*extra)[nxt].label == lbl) { // don't store the same label twice + while (*nxt >= 0) { + if ((*extra)[*nxt].label == lbl) { // don't store the same label twice skip = true; break; } - nxt = (*extra)[nxt].next; + nxt = &(*extra)[*nxt].next; } if (skip) { continue; } // new predigit will be added in the end of the chain - nxt = extra->size(); + *nxt = extra->size(); extra->emplace_back(lbl); } }