terrymanu commented on a change in pull request #11641:
URL: https://github.com/apache/shardingsphere/pull/11641#discussion_r682453005



##########
File path: 
shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/resultset/ResultSetUtil.java
##########
@@ -115,14 +115,14 @@ public static Object convertBigDecimalValue(final Object 
value, final boolean ne
     }
   
     private static BigDecimal adjustBigDecimalResult(final BigDecimal value, 
final boolean needScale, final int scale) {
-        if (needScale) {
-            try {
-                return value.setScale(scale);
-            } catch (final ArithmeticException ex) {
-                return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
-            }
-        }
-        return value;
+        if (!needScale){
+            return value;
+        }
+        try {
+            return value.setScale(scale);
+        } catch (final ArithmeticException ex) {
+            return value.setScale(scale, BigDecimal.ROUND_HALF_UP);
+        }

Review comment:
       This is guard clauses, please keep the original codes




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to