Skip to content

Commit f58ca4b

Browse files
committed
no need for temporary vector now that a span is returned
1 parent 7cd3c42 commit f58ca4b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

PWGUD/Core/UDHelpers.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,14 @@ float FT0AmplitudeC(TFT0 ft0)
316316
template <typename TFDD>
317317
float FDDAmplitudeA(TFDD fdd)
318318
{
319-
std::vector<int16_t> ampsA(fdd.chargeA(), fdd.chargeA() + 8);
320-
return std::accumulate(ampsA.begin(), ampsA.end(), 0);
319+
return std::accumulate(fdd.chargeA().begin(), fdd.chargeA().end(), 0);
321320
}
322321

323322
// -----------------------------------------------------------------------------
324323
template <typename TFDD>
325324
float FDDAmplitudeC(TFDD fdd)
326325
{
327-
std::vector<int16_t> ampsC(fdd.chargeC(), fdd.chargeC() + 8);
328-
return std::accumulate(ampsC.begin(), ampsC.end(), 0);
326+
return std::accumulate(fdd.chargeC().begin(), fdd.chargeC().end(), 0);
329327
}
330328

331329
// -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)