mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:21:04 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user