From 9d6f8155fdf2f98062a2a7b6d622136a80663c92 Mon Sep 17 00:00:00 2001 From: wr <1754607820@qq.com> Date: Mon, 10 Feb 2025 16:29:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detection/service/impl/DetectionServiceImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java b/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java index ad7d1bb1..f7a97c41 100644 --- a/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java +++ b/detection/src/main/java/com/njcn/gather/detection/service/impl/DetectionServiceImpl.java @@ -1125,13 +1125,12 @@ public class DetectionServiceImpl { public List getDoubles(List t) { if (CollUtil.isNotEmpty(t)) { - if (t == null || t.size() < 2) { - return t; + if (t.size() > 2) { + Double max = Collections.max(t); + Double min = Collections.min(t); + t.remove(max); + t.remove(min); } - Double max = Collections.max(t); - Double min = Collections.min(t); - t.remove(max); - t.remove(min); } return t; }