Fix range() with negative increments

fixes #9999
This commit is contained in:
Jean Flach 2015-08-26 16:30:36 +02:00
parent 01ced1549a
commit 73d8ffb462
1 changed files with 1 additions and 2 deletions

View File

@ -227,9 +227,8 @@ Array::Ptr ScriptUtils::Range(const std::vector<Value>& 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;
}