refactor: optimize SqlUtil.toBool()

This commit is contained in:
开源海哥 2023-07-19 17:46:30 +08:00
parent 198569e743
commit b79ce0622f

View File

@ -91,14 +91,11 @@ public class SqlUtil {
* @return {@code true} 操作成功{@code false} 操作失败 * @return {@code true} 操作成功{@code false} 操作失败
*/ */
public static boolean toBool(int[] results) { public static boolean toBool(int[] results) {
int result = 0; for (int result : results) {
for (int i : results) {
result += i;
if (result > 0) { if (result > 0) {
return true; return true;
} }
} }
return false; return false;
} }