Fix DetectedOperationService "Index was outside the bounds of the array" wile skipping

This commit is contained in:
ngfrolov 2024-07-26 17:25:05 +05:00
parent 2f5dfaae36
commit b4406338db
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -237,12 +237,9 @@ public class DetectedOperationService : IDetectedOperationService
break; break;
} }
var skip = 1; var point0 = detectableTelemetries[positionBegin];
while (positionBegin < positionEnd && IsChangingTelemetryInterval(point0, detectableTelemetries[++positionBegin]))
while (IsChangingTelemetryInterval(detectableTelemetries[positionBegin], detectableTelemetries[positionBegin + skip])) ;
skip++;
positionBegin += skip;
} }
return (detectableTelemetries[positionBegin].DateTime, detectedOperations); return (detectableTelemetries[positionBegin].DateTime, detectedOperations);