refactor: 使用 getFirst 优化首元素访问

This commit is contained in:
疯狂的狮子Li
2026-06-11 13:57:43 +08:00
parent d8f8d5493d
commit 0d72999366
14 changed files with 22 additions and 22 deletions
@@ -59,7 +59,7 @@ public class SnailJobConfig {
if (StringUtils.isNotBlank(serverName)) {
List<ServiceInstance> instances = discoveryClient.getInstances(serverName);
if (CollUtil.isNotEmpty(instances)) {
ServiceInstance instance = instances.get(0);
ServiceInstance instance = instances.getFirst();
System.setProperty("snail-job.server.host", instance.getHost());
System.setProperty("snail-job.server.port", properties.getPort());
}