Cleanup pass over llvm::seq uses (#5185)

I was thinking about this after `seq` changes in #5182, and looked for
other uses that might be replaceable. Here's the resulting cleanup
around `seq`:

- Switch to `enumerate` or `zip` when possible.
- `int _` -> `auto _` (it's typically a `size_t`, but there's no reason
to cast when unused)
- Fix a case of cast style `(size_t)...` -> `static_cast<size_t>(...)`
- Switch `(void)close_children_count` to `[[maybe_unused]]`
This commit is contained in:
Jon Ross-Perkins
2025-03-26 19:25:03 +00:00
committed by GitHub
parent acbe6530c3
commit 0d3d829478
9 changed files with 37 additions and 40 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ TEST(SourceGenTest, Identifiers) {
// Check that repeated calls are different in interesting ways, but have the
// exact same total bytes.
ssize_t idents_size_sum = SumSizes(idents);
for ([[maybe_unused]] int _ : llvm::seq(10)) {
for ([[maybe_unused]] auto _ : llvm::seq(10)) {
auto idents2 = gen.GetShuffledIdentifiers(1000);
EXPECT_THAT(idents2, SizeIs(1000));
// Should be (at least) a different shuffle of identifiers.