You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .grit/patterns/java/no_big_decimal_double.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,8 @@
1
1
---
2
-
title: "BigDecimal(double)"should not be used
2
+
title: "`BigDecimal(double)` should not be used"
3
3
tags: [java]
4
4
---
5
5
6
-
# "BigDecimal(double)" should not be used
7
-
8
6
Because of floating point imprecision, the `BigDecimal(double)` constructor can be somewhat unpredictable. It is better to use `BigDecimal.valueOf(double)`.
Copy file name to clipboardExpand all lines: .grit/patterns/js/no_return_assign.md
+2-7Lines changed: 2 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,9 @@ title: Hoist assignment out of `return` statement
3
3
tags: [good, se]
4
4
---
5
5
6
-
# {{ page.title }}
7
-
8
-
This rule hoists the assignments out of `return`. Does not apply when assignment is wrapped in parentheses.
6
+
This rule hoists the assignments out of `return`. Because an assignment, `=` is easy to confuse with a comparison, `==`, The best practice is not to use any assignments in return statements.
9
7
8
+
This does not apply when assignment is wrapped in parentheses.
10
9
11
10
```grit
12
11
engine marzano(0.1)
@@ -21,10 +20,6 @@ language js
21
20
} => `$assignment;\n return $left;`
22
21
```
23
22
24
-
```
25
-
An assignment, `=`, is easy to confuse with a comparison, `==`. The best practice is not to use any assignments in return statements.
0 commit comments