sequences: change trim-head to not call length unless it needs to.

db4
John Benediktsson 2014-01-08 10:19:26 -08:00
parent b910ca090c
commit d87a1da62f
1 changed files with 2 additions and 2 deletions

View File

@ -985,8 +985,8 @@ PRIVATE>
<PRIVATE
: (trim-head) ( seq quot -- seq n )
over [ [ not ] compose find drop ] dip
[ length or ] keep swap ; inline
over [ [ not ] compose find drop ] dip swap
[ dup length ] unless* ; inline
: (trim-tail) ( seq quot -- seq n )
over [ [ not ] compose find-last drop ?1+ ] dip