Commit 6a4c4cea authored by Max Katsev's avatar Max Katsev Committed by Facebook Github Bot

Make groupByAdjacent work for move-only types

Summary: Same as regular groupBy

Reviewed By: ot

Differential Revision: D17843280

fbshipit-source-id: 33d74d7ed84b8c46509bf186bfa52e31d6284015
parent 149fed4b
...@@ -1268,7 +1268,7 @@ class GroupByAdjacent : public Operator<GroupByAdjacent<Selector>> { ...@@ -1268,7 +1268,7 @@ class GroupByAdjacent : public Operator<GroupByAdjacent<Selector>> {
if (key == newKey) { if (key == newKey) {
// grow the current group // grow the current group
values.push_back(value); values.push_back(std::forward<Value>(value));
} else { } else {
// flush the current group // flush the current group
GroupType group(key.value(), std::move(values)); GroupType group(key.value(), std::move(values));
...@@ -1279,7 +1279,7 @@ class GroupByAdjacent : public Operator<GroupByAdjacent<Selector>> { ...@@ -1279,7 +1279,7 @@ class GroupByAdjacent : public Operator<GroupByAdjacent<Selector>> {
// start a new group // start a new group
key.emplace(newKey); key.emplace(newKey);
values.clear(); values.clear();
values.push_back(value); values.push_back(std::forward<Value>(value));
} }
return true; return true;
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment