From 78f628dd6fca9be675376a20a753b6f4556e9844 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 12 Oct 2023 17:01:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=AD=A5=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E6=89=B9=E9=87=8F=E6=8F=90=E4=BA=A4=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../storager/impl/VideoManagerStorageImpl.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index e96e09b2..d4062255 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -169,7 +169,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } } } - if (channels.size() > 0) { + if (!channels.isEmpty()) { for (DeviceChannel channel : channels) { if (subContMap.get(channel.getChannelId()) != null){ Integer count = subContMap.get(channel.getChannelId()); @@ -190,19 +190,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } try { int limitCount = 50; - int cleanChannelsResult = 0; - if (channels.size() > limitCount) { - for (int i = 0; i < channels.size(); i += limitCount) { - int toIndex = i + limitCount; - if (i + limitCount > channels.size()) { - toIndex = channels.size(); - } - cleanChannelsResult += this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels.subList(i, toIndex)); - } - } else { - cleanChannelsResult = this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); - } - boolean result = cleanChannelsResult < 0; + boolean result = false; if (!result && addChannels.size() > 0) { if (addChannels.size() > limitCount) { for (int i = 0; i < addChannels.size(); i += limitCount) {