@@ -321,6 +321,8 @@ inline pandora::StatusCode LArCaloHitFactory::Read(Parameters ¶meters, 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 ¶meters, 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 ¶meters, 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