-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove unused local variables #22340
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,3 +119,5 @@ linters-settings: | |
- regexpMust | ||
- appendAssign | ||
- ifElseChain | ||
unused: | ||
local-variables-are-used: false | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -588,6 +588,7 @@ func validateOrder(mtxs []sdk.Tx) error { | |
} | ||
} | ||
} | ||
_ = iterations | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused variable 'iterations' should be removed The variable Apply the following diff to eliminate the unused variable: func validateOrder(mtxs []sdk.Tx) error {
- iterations := 0
var itxs []txSpec
for i, mtx := range mtxs {
- iterations++
tx := mtx.(testTx)
itxs = append(itxs, txSpec{p: int(tx.priority), n: int(tx.nonce), a: tx.address, i: i})
}
// Existing logic...
- _ = iterations
// fmt.Printf("validation in iterations: %d\n", iterations)
return nil
}
|
||
// fmt.Printf("validation in iterations: %d\n", iterations) | ||
zakir-code marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reconsider disabling unused local variable checks
This change appears to contradict the PR's objective of removing unused local variables. Setting
local-variables-are-used: false
will prevent the linter from detecting unused variables, which could lead to code quality issues and dead code accumulation in the future.Consider removing these lines to maintain strict checking for unused variables:
📝 Committable suggestion
🧰 Tools
🪛 yamllint