Skip to content

Commit

Permalink
reserve vector size
Browse files Browse the repository at this point in the history
  • Loading branch information
gangatp committed Dec 8, 2023
1 parent a94fdb3 commit 92aa992
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,21 @@ namespace NMR {
PModelReaderNode_StringValue pXMLNode = std::make_shared<CModelReaderNode_StringValue>(m_pWarnings);
pXMLNode->parseXML(pXMLReader);
std::string result = base64_decode(pXMLNode->getValue());
m_iv.reserve(result.size());
if(!result.empty())
m_iv.insert(m_iv.begin(), result.begin(), result.end());
} else if (strcmp(pChildName, XML_3MF_SECURE_CONTENT_TAG) == 0) {
PModelReaderNode_StringValue pXMLNode = std::make_shared<CModelReaderNode_StringValue>(m_pWarnings);
pXMLNode->parseXML(pXMLReader);
std::string result = base64_decode(pXMLNode->getValue());
m_tag.reserve(result.size());
if (!result.empty())
m_tag.insert(m_tag.begin(), result.begin(), result.end());
} else if (strcmp(pChildName, XML_3MF_SECURE_CONTENT_AAD) == 0) {
PModelReaderNode_StringValue pXMLNode = std::make_shared<CModelReaderNode_StringValue>(m_pWarnings);
pXMLNode->parseXML(pXMLReader);
std::string result = base64_decode(pXMLNode->getValue());
m_aad.reserve(result.size());
if (!result.empty())
m_aad.insert(m_aad.begin(), result.begin(), result.end());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ namespace NMR {
pNode->parseXML(pXMLReader);
try {
std::string result = base64_decode(pNode->getValue());
m_sCipherValue.reserve(result.size());
if(!result.empty())
m_sCipherValue.insert(m_sCipherValue.begin(), result.begin(), result.end());
}
Expand Down

0 comments on commit 92aa992

Please sign in to comment.