Fix reserve bug (#1144)

This commit is contained in:
Ichiro 2022-01-03 10:24:06 +09:00 committed by GitHub
parent e2842c9de5
commit 29732a94ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1663,7 +1663,7 @@ void [[className]]::get{%relationshipClassName%}(const DbClientPtr &clientPtr,
<< *{%nameTransform(relationship.originalKey(), false)%}_
>> [rcb = std::move(rcb)](const Result &r){
std::vector<{%relationshipClassName%}> ret;
ret.reserve(ret.size());
ret.reserve(r.size());
for (auto const &row : r)
{
ret.emplace_back({%relationshipClassName%}(row));
@ -1717,7 +1717,7 @@ void [[className]]::get{%relationshipClassName%}(const DbClientPtr &clientPtr,
<< *{%nameTransform(relationship.originalKey(), false)%}_
>> [rcb = std::move(rcb)](const Result &r){
std::vector<std::pair<{%relationshipClassName%},{%pivotTableClassName%}>> ret;
ret.reserve(ret.size());
ret.reserve(r.size());
for (auto const &row : r)
{
ret.emplace_back(std::pair<{%relationshipClassName%},{%pivotTableClassName%}>(