Adopted paren-cond ternary operator style
So: x = (cond) ? yes : no; Where there are always parentheses around the condition, even if not required for disambiguity. Additional parentheses are always allowed, but the parenthesized condition helps signal that a ternary operator is coming earlier in the expression. This style has grown on me as I think it helps code readability. It reminds me of the required parentheses for if/while statements. Might as well adopt codebase-wide.
This commit is contained in:
+1
-1
@@ -187,7 +187,7 @@ static inline int32_t lfs_sclamp32(int32_t a, int32_t min, int32_t max) {
|
||||
|
||||
// Absolute value of signed numbers
|
||||
static inline int32_t lfs_abs32(int32_t a) {
|
||||
return a < 0 ? -a : a;
|
||||
return (a < 0) ? -a : a;
|
||||
}
|
||||
|
||||
// TODO how many of these do we actually need
|
||||
|
||||
Reference in New Issue
Block a user