optimization

This commit is contained in:
Robin Müller 2023-08-16 13:15:34 +02:00
parent 073cb4b3d5
commit 9ef63825f3
Signed by: muellerr
GPG Key ID: FCE0B2BD2195142F
2 changed files with 5 additions and 5 deletions

View File

@ -356,15 +356,15 @@ ReturnValue_t cfdp::DestHandler::startTransaction(MetadataPduReader& reader,
transactionParams.fileSize);
params.destFileName = transactionParams.destName.data();
params.sourceFileName = transactionParams.sourceName.data();
unsigned tlvIdx = 0;
params.numberOfMsgsToUser = 0;
for (const auto& opt : tlvVec) {
if (opt.getType() == TlvType::MSG_TO_USER) {
msgToUserVec[tlvIdx] = MessageToUserTlv(opt.getValue(), opt.getLengthField());
tlvIdx++;
msgToUserVec[params.numberOfMsgsToUser] =
MessageToUserTlv(opt.getValue(), opt.getLengthField());
params.numberOfMsgsToUser++;
}
}
params.msgsToUserArray = msgToUserVec.data();
params.msgsToUserLen = tlvIdx;
destParams.user.metadataRecvdIndication(params);
return result;
}

View File

@ -35,7 +35,7 @@ struct MetadataRecvdParams {
Fss fileSize{};
const char* sourceFileName = "";
const char* destFileName = "";
size_t msgsToUserLen = 0;
size_t numberOfMsgsToUser = 0;
const MessageToUserTlv* msgsToUserArray = nullptr;
};