mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 21:11:27 +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:
@@ -1034,7 +1034,7 @@ TEST_F(LexerTest, TypeLiteralTooManyDigits) {
|
||||
// A 128-bit APInt should be plenty large, but if needed in the future it can
|
||||
// be widened without issue.
|
||||
llvm::APInt bits = llvm::APInt::getZero(128);
|
||||
for ([[maybe_unused]] int _ : llvm::seq(1, 30)) {
|
||||
for ([[maybe_unused]] auto _ : llvm::seq(1, 30)) {
|
||||
code.append("9");
|
||||
bits = bits * 10 + 9;
|
||||
auto [buffer, value_stores] =
|
||||
@@ -1160,7 +1160,7 @@ TEST_F(LexerTest, DiagnosticFileTooLarge) {
|
||||
static constexpr size_t NumLines = 10'000'000;
|
||||
std::string input;
|
||||
input.reserve(NumLines * 3);
|
||||
for ([[maybe_unused]] int _ : llvm::seq(NumLines)) {
|
||||
for ([[maybe_unused]] auto _ : llvm::seq(NumLines)) {
|
||||
input += "{}\n";
|
||||
}
|
||||
EXPECT_CALL(consumer,
|
||||
|
||||
Reference in New Issue
Block a user