Skip to content
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

代码优化。if else 改 switch case #137

Closed
wants to merge 2 commits into from
Closed

代码优化。if else 改 switch case #137

wants to merge 2 commits into from

Conversation

kvii
Copy link

@kvii kvii commented Jul 5, 2020

lib/net/error_handle.dart 中的 handleExceptionif else 语句改为 switch case 语句,并未做逻辑上的修改.
注意 代码修改后未经测试,仅做目视检查
详见提交分支中的 README.md

@simplezhli
Copy link
Owner

感谢你的RP!不过对于这个判断优化,我想采用枚举拓展加Map替代分支语句,毕竟实际的错误类型不止这些,switch在这种情况下也不是一个好的方案。

@kvii kvii closed this Jul 5, 2020
simplezhli added a commit that referenced this pull request Jul 6, 2020
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.

2 participants