Skip to content

Simplified if statement#232

Open
Plotnus wants to merge 1 commit intoadnanaziz:masterfrom
Plotnus:patch-1
Open

Simplified if statement#232
Plotnus wants to merge 1 commit intoadnanaziz:masterfrom
Plotnus:patch-1

Conversation

@Plotnus
Copy link
Copy Markdown
Contributor

@Plotnus Plotnus commented Apr 25, 2022

I believe this change simplifies things as they are logical equivalents.

bool b = false;
if (expr) {
  b = true;
}

equivalent to

bool b = expr;

I believe this change simplifies things as they are logical equivalents.
Classic example of the following which happens a lot.
```
bool b = false;
if (expr) {
  b = true;
}
// same as
bool b = expr;
```
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.

1 participant