]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compression/inflate/inflate.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / compression / inflate / inflate.factor
index 05ec94a794daa8c79f4b9322d6028987fcd23b8c..ff38f94c68a236521540f498c56656f86049ac2c 100644 (file)
@@ -64,7 +64,7 @@ CONSTANT: clen-shuffle { 16 17 18 0 8 7 9 6 10 5 11 4 12 3 13 2 14 1 15 }
         k swap - dup k! 0 >
     ] 
     [ ] produce swap suffix
-    { } [ dup array? [ dup first 16 = ] [ f ] if [ [ unclip-last ] [ second 1+ swap <repetition> append ] bi* ] [ suffix ] if ] reduce
+    { } [ dup array? [ dup first 16 = ] [ f ] if [ [ unclip-last ] [ second 1 + swap <repetition> append ] bi* ] [ suffix ] if ] reduce
     [ dup array? [ second 0 <repetition> ] [ 1array ] if ] map concat
     nip swap cut 2array [ [ length>> [0,b) ] [ ] bi get-table ] map ;
     
@@ -91,14 +91,14 @@ CONSTANT: dist-table
     }
 
 : nth* ( n seq -- elt )
-    [ length 1- swap - ] [ nth ] bi ;
+    [ length 1 - swap - ] [ nth ] bi ;
 
 :: inflate-lz77 ( seq -- bytes )
     1000 <byte-vector> :> bytes
     seq
     [
         dup array?
-        [ first2 '[ _ 1- bytes nth* bytes push ] times ]
+        [ first2 '[ _ 1 - bytes nth* bytes push ] times ]
         [ bytes push ] if
     ] each 
     bytes ;