pitrou commented on code in PR #12891:
URL: https://github.com/apache/arrow/pull/12891#discussion_r855376851
##########
cpp/src/arrow/util/vector.h:
##########
@@ -78,8 +78,8 @@ std::vector<T> ReplaceVectorElement(const std::vector<T>&
values, size_t index,
template <typename T, typename Predicate>
std::vector<T> FilterVector(std::vector<T> values, Predicate&& predicate) {
- auto new_end =
- std::remove_if(values.begin(), values.end(),
std::forward<Predicate>(predicate));
+ auto new_end = std::stable_partition(values.begin(), values.end(),
Review Comment:
Yeah, inverting it would probably be slightly more efficient than calling a
stable partition (which can allocate temporary memory AFAIU).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]