几个小优化:

1.优化CollUtil.map()方法, 减少流中的无意义操作;
2.优化ArrayUtil.get()方法, 使用合理的逻辑判断 代替 使用异常判断null值;
This commit is contained in:
Zjp
2022-11-10 17:27:28 +08:00
parent b7d91489f4
commit ab39b7410f
4 changed files with 15 additions and 11 deletions

View File

@@ -147,7 +147,7 @@ public class GraphTest {
Assert.assertEquals(asSet(2, 0), graph.getAdjacentPoints(3));
}
@SafeVarargs
private static <T> Set<T> asSet(T... ts) {
return new LinkedHashSet<>(Arrays.asList(ts));
}