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

Optimize imports, function comments, logic judgments, and return values #255

Merged
merged 4 commits into from Jan 21, 2022

Conversation

pemako
Copy link
Contributor

@pemako pemako commented Jan 20, 2022

Please provide issue(s) of this PR:
Fixes #

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Configuration
  • Docs
  • Installation
  • Performance and Scalability
  • Naming
  • HealthCheck
  • Test and Release

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include API changes, behavior changes, performance improvements, etc.

@pemako
Copy link
Contributor Author

pemako commented Jan 20, 2022

  • CHANGE:
  1. if condition
// old code
if value == false {}
// change to
if !value {}
  1. return bool value
// old code
if !ok {
	return false
}
return true
// change to
return ok
// old code
if a == b {
	return true
}
return false
// change to
return a == b

@pemako pemako changed the title 优化代码导入及注释 Optimize imports, function comments, logic judgments, and return values Jan 20, 2022
@chuntaojun chuntaojun added the code quality Prompt code readability, reduce repetitive code, improve code maintainability, code comment label Jan 21, 2022
@chuntaojun chuntaojun linked an issue Jan 21, 2022 that may be closed by this pull request
8 tasks
@andrewshan andrewshan merged commit d355b6c into polarismesh:main Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Prompt code readability, reduce repetitive code, improve code maintainability, code comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polaris code quality optimization
3 participants