[libcxx-commits] [PATCH] D126529: [libc++] Implement ranges::find_first_of
Konstantin Varlamov via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 6 13:25:42 PDT 2022
var-const accepted this revision.
var-const added inline comments.
This revision is now accepted and ready to land.
================
Comment at: libcxx/include/__algorithm/ranges_find_first_of.h:43
+ for (; __first1 != __last1; ++__first1) {
+ for (auto __j = __first2; __j != __last2; ++__j) {
+ if (std::invoke(__pred, std::invoke(__proj1, *__first1), std::invoke(__proj2, *__j)))
----------------
philnik wrote:
> var-const wrote:
> > Why are we creating a new variable instead of incrementing `__first2`, which would be consistent with `__first1`?
> Because we go a few times over `[__first2, __last2)`.
Oh, sorry for missing that, it's quite obvious.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126529/new/
https://reviews.llvm.org/D126529
More information about the libcxx-commits
mailing list