From 73d8ffb462090974244157a2cd824eb0adde40f9 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Wed, 26 Aug 2015 16:30:36 +0200 Subject: [PATCH] Fix range() with negative increments fixes #9999 --- lib/base/scriptutils.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/base/scriptutils.cpp b/lib/base/scriptutils.cpp index 085c7260c..4d62522d9 100644 --- a/lib/base/scriptutils.cpp +++ b/lib/base/scriptutils.cpp @@ -227,9 +227,8 @@ Array::Ptr ScriptUtils::Range(const std::vector& arguments) (start > end && increment >= 0)) return result; - for (double i = start; i < end; i += increment) { + for (double i = start; (increment > 0 ? i < end : i > end); i += increment) result->Add(i); - } return result; } -- 2.40.0