From b79ce0622f314df8783d3cf72ee4b22228d8f0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=80=E6=BA=90=E6=B5=B7=E5=93=A5?= Date: Wed, 19 Jul 2023 17:46:30 +0800 Subject: [PATCH] refactor: optimize SqlUtil.toBool() --- .../src/main/java/com/mybatisflex/core/util/SqlUtil.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/SqlUtil.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/SqlUtil.java index 3e7c273a..2003c143 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/SqlUtil.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/util/SqlUtil.java @@ -91,14 +91,11 @@ public class SqlUtil { * @return {@code true} 操作成功,{@code false} 操作失败。 */ public static boolean toBool(int[] results) { - int result = 0; - for (int i : results) { - result += i; + for (int result : results) { if (result > 0) { return true; } } - return false; }