-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed single line `if` statements * Simplified clamping `position` to use `std::min`
- Loading branch information
1 parent
91206b8
commit 7bde55a
Showing
1 changed file
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7bde55a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You misunderstood. The only thing I was trying to prevent was the code on line 276 where the predicate and action were on the same line. You didn't need to put parens around everything. Leave it as is or change. Up to you.
7bde55a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I interpreted your message as wanting to avoid the future bug when someone adds more lines expecting them to be in the
if
-clause but they are not.This aspect of
if
-clauses doesn't seem to be called out explicitly by the coding style. I'm inclined to leave it as-is if that is alright. No big deal to revert and re-do as intended if not.7bde55a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few files that use the format:
if () do_something();
but not many.
We don't have coding rules, as such, but we ask people to try to follow the style of what's existing.