]> gitweb.factorcode.org Git - factor.git/commitdiff
lcs: more performance improvements.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 Mar 2013 04:16:34 +0000 (21:16 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 Mar 2013 04:16:34 +0000 (21:16 -0700)
basis/lcs/lcs.factor

index 08ab044ba03710829de27baf459b11fce05a044b..930fc53a91b3608c7d1dfb196a7ccb80ab7813ba 100644 (file)
@@ -1,5 +1,6 @@
 USING: accessors arrays combinators combinators.short-circuit\r
-kernel locals make math math.order sequences sequences.private ;\r
+kernel locals make math math.order sequences sequences.private\r
+typed ;\r
 IN: lcs\r
 \r
 <PRIVATE\r
@@ -10,7 +11,7 @@ IN: lcs
 : lcs-step ( insert delete change same? -- next )\r
     1 -1/0. ? + max max ; ! -1/0. is -inf (float)\r
 \r
-:: loop-step ( i j matrix old new step -- )\r
+TYPED:: loop-step ( i j matrix: array old new step -- )\r
     i j 1 + matrix nth-unsafe nth-unsafe ! insertion\r
     i 1 + j matrix nth-unsafe nth-unsafe ! deletion\r
     i j matrix nth-unsafe nth-unsafe ! replace/retain\r