Skip to content

Commit b436488

Browse files
[ADT] Use a C++17 fold expression in BitVector.h (NFC) (#161626)
This patch simplifies the assertion by replacing the std::all_of check with a more direct C++17 fold expression.
1 parent 18997b5 commit b436488

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/include/llvm/ADT/BitVector.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,7 @@ class BitVector {
570570
template <class F, class... ArgTys>
571571
static BitVector &apply(F &&f, BitVector &Out, BitVector const &Arg,
572572
ArgTys const &...Args) {
573-
assert(llvm::all_of(
574-
std::initializer_list<unsigned>{Args.size()...},
575-
[&Arg](auto const &BV) { return Arg.size() == BV; }) &&
576-
"consistent sizes");
573+
assert(((Arg.size() == Args.size()) && ...) && "consistent sizes");
577574
Out.resize(Arg.size());
578575
for (size_type I = 0, E = Arg.Bits.size(); I != E; ++I)
579576
Out.Bits[I] = f(Arg.Bits[I], Args.Bits[I]...);

0 commit comments

Comments
 (0)