sorting.insertion: faster with unsafe words.

db4
John Benediktsson 2013-10-14 15:28:05 -07:00
parent e4e4eb38c5
commit 327a40d4bf
1 changed files with 3 additions and 3 deletions

View File

@ -1,11 +1,11 @@
USING: locals sequences kernel math ;
USING: kernel locals math sequences sequences.private ;
IN: sorting.insertion
<PRIVATE
:: insert ( ... seq quot: ( ... elt -- ... elt' ) n -- ... )
n zero? [
n n 1 - [ seq nth quot call ] bi@ >= [
n n 1 - seq exchange
n n 1 - [ seq nth-unsafe quot call ] bi@ >= [
n n 1 - seq exchange-unsafe
seq quot n 1 - insert
] unless
] unless ; inline recursive