Test of start < limit at the beginning of do-loop os not necessary

This commit is contained in:
Koichi Nakamura 2021-01-11 07:55:39 +09:00
parent 5c0247875f
commit 9f862f44e1

View file

@ -1432,21 +1432,9 @@ do-stack 16 cells + do-sp !
\ compile: ( -- dest mark )
: do
compile 2dup
compile >r \ save start
compile >r \ save limit
\ Leave if start >= limit.
\ Have to write 'limit start swap 1- <= 0branch ...' but not
\ 'limit start > 0branch ...'
\ Since iteration range [start...limit) and [start...limit-1] is
\ different when limit-1 is the maximum unsigned integer.
compile swap
compile 1-
compile <=
compile 0branch
0 ,
here >do do-mark >do
here cell- >do leave-mark >do
; immediate
: leave ( -- orig mark )