From b4406338db18c1916d3eaf59e3b869367811804e Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 26 Jul 2024 17:25:05 +0500 Subject: [PATCH] Fix DetectedOperationService "Index was outside the bounds of the array" wile skipping --- .../DetectOperations/DetectedOperationService.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs b/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs index aacfe853..387999b2 100644 --- a/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs +++ b/AsbCloudInfrastructure/Services/DetectOperations/DetectedOperationService.cs @@ -237,12 +237,9 @@ public class DetectedOperationService : IDetectedOperationService break; } - var skip = 1; - - while (IsChangingTelemetryInterval(detectableTelemetries[positionBegin], detectableTelemetries[positionBegin + skip])) - skip++; - - positionBegin += skip; + var point0 = detectableTelemetries[positionBegin]; + while (positionBegin < positionEnd && IsChangingTelemetryInterval(point0, detectableTelemetries[++positionBegin])) + ; } return (detectableTelemetries[positionBegin].DateTime, detectedOperations);