Reduce number of copies in query::Parameters

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2564
This commit is contained in:
Matej Ferencevic 2019-11-23 16:48:54 +01:00
parent 3c615759b6
commit 42a4f310ff

View File

@ -33,10 +33,9 @@ struct Parameters {
* @return Value for the given token position.
*/
const PropertyValue &AtTokenPosition(int position) const {
auto found = std::find_if(storage_.begin(), storage_.end(),
[&](const std::pair<int, PropertyValue> a) {
return a.first == position;
});
auto found =
std::find_if(storage_.begin(), storage_.end(),
[&](const auto &a) { return a.first == position; });
CHECK(found != storage_.end())
<< "Token position must be present in container";
return found->second;