[chronojump] Fixed hang on sprintEncoder.R on seq when splitLength > testLength



commit 17e45cc9a23f2d4cc36b6eeab5b99bbf23aae599
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Feb 21 13:37:53 2022 +0100

    Fixed hang on sprintEncoder.R on seq when splitLength > testLength

 r-scripts/sprintEncoder.R | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/r-scripts/sprintEncoder.R b/r-scripts/sprintEncoder.R
index b8de2b9e0..f4d4939d3 100644
--- a/r-scripts/sprintEncoder.R
+++ b/r-scripts/sprintEncoder.R
@@ -931,7 +931,8 @@ start <- function(op)
        {
                if(dataFiles$splitLength[i] > 0)
                {
-                       splitPositionAll = c(splitPositionAll, seq(from=dataFiles$splitLength[i], 
to=dataFiles$testLength[i], by=dataFiles$splitLength[i]))
+                       if(dataFiles$splitLength[i] <= dataFiles$testLength[i])
+                               splitPositionAll = c(splitPositionAll, seq(from=dataFiles$splitLength[i], 
to=dataFiles$testLength[i], by=dataFiles$splitLength[i]))
                } else
                {
                        #as.character() because -1 (no triggers) is readed as a number and then the strsplit 
fails


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]