growable: use fixnum+fast and integer>fixnum.

db4
John Benediktsson 2013-03-23 14:37:02 -07:00
parent 544e5f81c5
commit f963b2eb1b
1 changed files with 6 additions and 6 deletions

View File

@ -16,12 +16,12 @@ M: growable set-nth-unsafe underlying>> set-nth-unsafe ; inline
<PRIVATE <PRIVATE
: push-unsafe ( elt seq -- ) : push-unsafe ( elt seq -- )
[ length ] keep [ length integer>fixnum ] keep
[ set-nth-unsafe ] [ [ 1 + ] dip length<< ] 2bi ; inline [ set-nth-unsafe ] [ [ 1 fixnum+fast ] dip length<< ] 2bi ; inline
: push-all-unsafe ( from to src dst -- ) : push-all-unsafe ( from to src dst -- )
[ over - swap ] 2dip [ pick ] dip [ length ] keep [ over - swap ] 2dip [ pick ] dip [ length integer>fixnum ] keep
[ [ + ] dip length<< ] 2keep <copy> (copy) drop ; inline [ [ fixnum+fast ] dip length<< ] 2keep <copy> (copy) drop ; inline
PRIVATE> PRIVATE>
@ -52,10 +52,10 @@ M: growable set-length ( n seq -- )
bounds-check-head bounds-check-head
2dup length >= [ 2dup length >= [
2dup capacity >= [ over new-size over expand ] when 2dup capacity >= [ over new-size over expand ] when
[ >fixnum ] dip [ integer>fixnum ] dip
over 1 fixnum+fast over length<< over 1 fixnum+fast over length<<
] [ ] [
[ >fixnum ] dip [ integer>fixnum ] dip
] if ; inline ] if ; inline
M: growable set-nth ensure set-nth-unsafe ; inline M: growable set-nth ensure set-nth-unsafe ; inline