[clang] f13019f - [clang] Use any_of and none_of (NFC)

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 10:17:41 PDT 2022


Hi David,

On Mon, Jun 13, 2022 at 2:00 PM David Blaikie <dblaikie at gmail.com> wrote:

> On Sun, Jun 12, 2022 at 10:17 AM Kazu Hirata via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> -      return args_end() != std::find_if(
>> -          args_begin(), args_end(),
>> -          [=](const ParamIdx &Idx) { return Idx.getASTIndex() == IdxAST;
>> });
>> +      return llvm::any_of(args(), [=](const ParamIdx &Idx) {
>> +        return Idx.getASTIndex() == IdxAST;
>> +      });
>>
>
> Generally, I think for locally scoped lambdas (lambdas that don't escape
> their scope) we should prefer/default to default reference capture (`[&]`)
> - it simplifies changes in the future. Would that be OK for these sort of
> cleanups?
>

Sure.  I've often wondered about the point of explicitly specifying
captures.

Kazu Hirata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220615/8262a41b/attachment.html>


More information about the cfe-commits mailing list