Skip to content

lint: run modernize mapsloop#6434

Merged
jannotti merged 3 commits intoalgorand:masterfrom
cce:modernize-mapsloop
Sep 5, 2025
Merged

lint: run modernize mapsloop#6434
jannotti merged 3 commits intoalgorand:masterfrom
cce:modernize-mapsloop

Conversation

@cce
Copy link
Copy Markdown
Contributor

@cce cce commented Sep 4, 2025

Summary

This runs the official golang tool modernize with the mapsloop fix.

Test Plan

Existing tests should pass

algorandskiy
algorandskiy previously approved these changes Sep 4, 2025
jannotti
jannotti previously approved these changes Sep 4, 2025
Copy link
Copy Markdown
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all good. In many cases, maps.Clone() would be even better. I suspect the tool doesn't do that replacement because map.Clone() is nil-preserving, while these code snippets generally allocate a 0 sized map instead. We'd have to check to see if that's ok.

Comment thread agreement/fuzzer/ledger_test.go
Comment thread config/consensus.go Outdated
@cce cce dismissed stale reviews from jannotti and algorandskiy via 6335bed September 5, 2025 00:12
algorandskiy
algorandskiy previously approved these changes Sep 5, 2025
Comment thread ledger/acctupdates_test.go Outdated
Comment thread network/multiplexer.go Outdated
@cce cce requested a review from jannotti September 5, 2025 14:27
@jannotti jannotti merged commit fc11afb into algorand:master Sep 5, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants