Skip to content

Remove unnecessary value assignments throughout the codebase#78538

Merged
YuriSizov merged 1 commit intogodotengine:masterfrom
Sauermann:fix-code-simplifications
Jul 12, 2023
Merged

Remove unnecessary value assignments throughout the codebase#78538
YuriSizov merged 1 commit intogodotengine:masterfrom
Sauermann:fix-code-simplifications

Conversation

@Sauermann
Copy link
Contributor

CPPcheck found most of them.

no need to assign the variable twice:

  • AnimationTrackEditTypeAudio
  • SSEffects

variable is assigned in all if-else clauses:

  • EditorHelp
  • AndroidInputHandler
  • MenuBar
  • ShaderCompiler

same if clause:

  • ItemList

clearing an empty bitfield has no effect:

  • Viewport

@Sauermann Sauermann requested review from a team as code owners June 21, 2023 20:30
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

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

LGTM, these all make sense

CPPcheck found most of them.

no need to assign the variable twice:
- AnimationTrackEditTypeAudio
- SSEffects

variable is assigned in all if-else clauses:
- EditorHelp
- AndroidInputHandler
- MenuBar
- ShaderCompiler

same if clause:
- ItemList

clearing an empty bitfield has no effect:
- Viewport
@akien-mga akien-mga added this to the 4.2 milestone Jun 21, 2023
@YuriSizov YuriSizov changed the title Code simplifications Remove unnecessary value assignments throughout the codebase Jul 12, 2023
@YuriSizov YuriSizov merged commit 5dff3c4 into godotengine:master Jul 12, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@Sauermann Sauermann deleted the fix-code-simplifications branch July 12, 2023 17:28
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.

4 participants