Skip to content

all: simplify switches#17267

Merged
karalabe merged 2 commits intoethereum:masterfrom
cristaloleg:all/simplify-switches
Jul 30, 2018
Merged

all: simplify switches#17267
karalabe merged 2 commits intoethereum:masterfrom
cristaloleg:all/simplify-switches

Conversation

@cristaloleg
Copy link
Contributor

Again, some simplifications from go-critic's team 🖐
Linter's log:

check-package: $GOPATH/src/github.com/ethereum/go-ethereum/p2p/simulations/adapters/inproc.go:356:2: singleCaseSwitch: should rewrite switch statement to if statement
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/core/blockchain_test.go:1149:3: singleCaseSwitch: should rewrite switch statement to if statement
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/les/handler.go:1161:2: singleCaseSwitch: should rewrite switch statement to if statement
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/eth/tracers/tracer.go:490:2: singleCaseSwitch: found switch with default case only
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/eth/handler.go:747:3: singleCaseSwitch: should rewrite switch statement to if statement
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/p2p/nat/natpmp.go:118:4: singleCaseSwitch: should rewrite switch statement to if statement
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/p2p/nat/natupnp.go:84:4: singleCaseSwitch: should rewrite switch statement to if statement
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/eth/filters/filter_system.go:341:3: singleCaseSwitch: should rewrite switch statement to if statement
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/metrics/exp/exp.go:150:3: typeSwitchVar: case 0 can benefit from type switch with assignment
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/metrics/exp/exp.go:150:3: typeSwitchVar: case 1 can benefit from type switch with assignment
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/metrics/exp/exp.go:150:3: typeSwitchVar: case 2 can benefit from type switch with assignment
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/metrics/exp/exp.go:150:3: typeSwitchVar: case 3 can benefit from type switch with assignment
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/metrics/exp/exp.go:150:3: typeSwitchVar: case 4 can benefit from type switch with assignment
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/metrics/exp/exp.go:150:3: typeSwitchVar: case 5 can benefit from type switch with assignment
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/metrics/exp/exp.go:150:3: typeSwitchVar: case 6 can benefit from type switch with assignment
check-package: $GOPATH/src/github.com/ethereum/go-ethereum/signer/core/abihelper.go:46:2: typeSwitchVar: case 0 can benefit from type switch with assignment

@GitCop
Copy link

GitCop commented Jul 29, 2018

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 85aeb74
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

Really nice, thank you!

@karalabe karalabe added this to the 1.8.13 milestone Jul 30, 2018
@karalabe karalabe merged commit d42ce0f into ethereum:master Jul 30, 2018
@cristaloleg cristaloleg deleted the all/simplify-switches branch July 30, 2018 09:32
@cristaloleg
Copy link
Contributor Author

Thanks! 😉

firmianavan pushed a commit to firmianavan/go-ethereum that referenced this pull request Aug 28, 2018
* all: simplify switches

* silly mistake
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Mar 18, 2024
MariusVanDerWijden pushed a commit to MariusVanDerWijden/go-ethereum that referenced this pull request Feb 2, 2026
* all: simplify switches

* silly mistake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants