Skip to content

Commit 152a69f

Browse files
authoredJan 2, 2025
ORM:Avoid unnecessary copies when returning search results (drogonframework#2237)
1 parent 38dd5fe commit 152a69f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎orm_lib/inc/drogon/orm/Mapper.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1053,9 +1053,9 @@ inline void Mapper<T>::findBy(const Criteria &criteria,
10531053
std::vector<T> ret;
10541054
for (auto const &row : r)
10551055
{
1056-
ret.push_back(T(row));
1056+
ret.emplace_back(row);
10571057
}
1058-
rcb(ret);
1058+
rcb(std::move(ret));
10591059
};
10601060
binder >> ecb;
10611061
}

0 commit comments

Comments
 (0)
Please sign in to comment.