Skip to content

Commit 108d767

Browse files
committed
Update for static code checks
1 parent b8d7596 commit 108d767

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

larpandoracontent/LArObjects/LArCaloHit.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ inline pandora::StatusCode LArCaloHitFactory::Read(Parameters &parameters, pando
321321
if (m_version > 2)
322322
{
323323
PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, binaryFileReader.ReadVariable(nLabels));
324+
hitScores.reserve(nLabels);
325+
hitScoreLabels.reserve(nLabels);
324326
for (unsigned int i = 0; i < nLabels; ++i)
325327
{
326328
float score;
@@ -342,6 +344,8 @@ inline pandora::StatusCode LArCaloHitFactory::Read(Parameters &parameters, pando
342344
if (m_version > 2)
343345
{
344346
PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, xmlFileReader.ReadVariable("NHitLabels", nLabels));
347+
hitScores.reserve(nLabels);
348+
hitScoreLabels.reserve(nLabels);
345349
for (unsigned int i = 0; i < nLabels; ++i)
346350
{
347351
float score;
@@ -362,8 +366,8 @@ inline pandora::StatusCode LArCaloHitFactory::Read(Parameters &parameters, pando
362366
LArCaloHitParameters &larCaloHitParameters(dynamic_cast<LArCaloHitParameters &>(parameters));
363367
larCaloHitParameters.m_larTPCVolumeId = larTPCVolumeId;
364368
larCaloHitParameters.m_daughterVolumeId = daughterVolumeId;
365-
larCaloHitParameters.m_hitScores = hitScores;
366-
larCaloHitParameters.m_hitScoreLabels = hitScoreLabels;
369+
larCaloHitParameters.m_hitScores = std::move(hitScores);
370+
larCaloHitParameters.m_hitScoreLabels = std::move(hitScoreLabels);
367371

368372
return pandora::STATUS_CODE_SUCCESS;
369373
}

0 commit comments

Comments
 (0)