patch 9.0.0615: using reduce() on a list from range() is a bit slow

Problem:    Using reduce() on a list from range() is a bit slow.
Solution:   Avoid materializing the list.
diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim
index 7c707d4..168ef07 100644
--- a/src/testdir/test_listdict.vim
+++ b/src/testdir/test_listdict.vim
@@ -1015,6 +1015,12 @@
       call assert_equal('x y z', reduce(['x', 'y', 'z'], LSTART acc, val LMIDDLE acc .. ' ' .. val LEND))
       call assert_equal(120, range(1, 5)->reduce(LSTART acc, val LMIDDLE acc * val LEND))
 
+      call assert_equal(0, range(1)->reduce(LSTART acc, val LMIDDLE acc + val LEND))
+      call assert_equal(1, range(2)->reduce(LSTART acc, val LMIDDLE acc + val LEND))
+      call assert_equal(3, range(3)->reduce(LSTART acc, val LMIDDLE acc + val LEND))
+      call assert_equal(6, range(4)->reduce(LSTART acc, val LMIDDLE acc + val LEND))
+      call assert_equal(10, range(5)->reduce(LSTART acc, val LMIDDLE acc + val LEND))
+
       call assert_equal(1, reduce(0z, LSTART acc, val LMIDDLE acc + val LEND, 1))
       call assert_equal(1 + 0xaf + 0xbf + 0xcf, reduce(0zAFBFCF, LSTART acc, val LMIDDLE acc + val LEND, 1))
       call assert_equal(2 * (2 * 1 + 0xaf) + 0xbf, 0zAFBF->reduce(LSTART acc, val LMIDDLE 2 * acc + val LEND, 1))
@@ -1038,6 +1044,7 @@
   vim9 assert_equal({'x': 1, 'y': 1, 'z': 1 }, ['x', 'y', 'z']->reduce((acc, val) => extend(acc, {[val]: 1 }), {}))
 
   call assert_fails("call reduce([], { acc, val -> acc + val })", 'E998: Reduce of an empty List with no initial value')
+  call assert_fails("call reduce(range(0), { acc, val -> acc + val })", 'E998: Reduce of an empty List with no initial value')
   call assert_fails("call reduce(0z, { acc, val -> acc + val })", 'E998: Reduce of an empty Blob with no initial value')
   call assert_fails("call reduce(test_null_blob(), { acc, val -> acc + val })", 'E998: Reduce of an empty Blob with no initial value')
   call assert_fails("call reduce('', { acc, val -> acc + val })", 'E998: Reduce of an empty String with no initial value')