Skip to content

Commit

Permalink
use reserve to allocate memory
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-hx committed Sep 18, 2024
1 parent 5d79844 commit 62fee43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp/lib/ResultSetPutGet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ ResultSetPutGet::ResultSetPutGet(ITransferResult *result) :
ResultSet(SF_PUTGET_FORMAT),
m_cmdType(result->getCommandType())
{
m_values.reserve(result->getResultSize());
while (result->next())
{
std::vector<std::string> row;
row.reserve(result->getColumnSize());
for (unsigned int i = 0; i < result->getColumnSize(); i++)
{
row.emplace_back();
Expand Down

0 comments on commit 62fee43

Please sign in to comment.