     }
 
 : nth* ( n seq -- elt )
-    [ length 1 - swap - ] [ nth ] bi ;
+    [ length 1 - swap - ] [ nth ] bi ; inline
 
 :: inflate-lz77 ( seq -- bytes )
     1000 <byte-vector> :> bytes
-    seq
-    [
+    seq [
         dup array?
         [ first2 '[ _ 1 - bytes nth* bytes push ] times ]
         [ bytes push ] if
-    ] each 
+    ] each
     bytes ;
 
 :: inflate-huffman ( bitstream tables -- bytes )
     tables bitstream '[ _ swap <huffman-decoder> ] map :> tables
     [
         tables first read1-huff2
-        dup 256 >
-        [
-            dup 285 = 
-            [ ]
-            [ 
-                dup 264 > 
-                [ 
-                    dup 261 - 4 /i dup 5 > 
-                    [ bad-zlib-data ] when 
-                    bitstream bs:read 2array 
-                ]
-                when 
-            ] if
+        dup 256 > [
+            dup 285 = [
+                dup 264 > [
+                    dup 261 - 4 /i dup 5 >
+                    [ bad-zlib-data ] when
+                    bitstream bs:read 2array
+                ] when
+            ] unless
             ! 5 bitstream read-bits ! distance
             tables second read1-huff2
-            dup 3 > 
-            [ 
+            dup 3 > [
                 dup 2 - 2 /i dup 13 >
                 [ bad-zlib-data ] when
                 bitstream bs:read 2array
-            ] 
-            when
-            2array
-        ]
-        when
+            ] when 2array
+        ] when
         dup 256 = not
-    ]
-    [ ] produce nip
+    ] [ ] produce nip
     [
         dup array? [
-            first2
-            [  
+            first2 [
                 dup array? [ first2 ] [ 0 ] if
                 [ 257 - length-table nth ] [ + ] bi*
-            ] 
-            [
+            ] [
                 dup array? [ first2 ] [ 0 ] if
                 [ dist-table nth ] [ + ] bi*
-            ] bi*
-            2array
+            ] bi* 2array
         ] when
     ] map ;
-    
-:: inflate-raw ( bitstream -- bytes ) 
-    8 bitstream bs:align 
+
+:: inflate-raw ( bitstream -- bytes )
+    8 bitstream bs:align
     16 bitstream bs:read :> len
     16 bitstream bs:read :> nlen
     len nlen + 16 >signed -1 assert= ! len + ~len = -1


CONSTANT: dist-table
    {
        1 2 3 4 
        5 7 9 13 
        17 25 33 49
        65 97 129 193
        257 385 513 769

        } cond
        dup array? [ dup second ] [ 1 ] if
        k swap - dup k! 0 >
    ]
    [ ] produce swap suffix
    { } [
            dup { [ array? ] [ first 16 = ] } 1&& [
                [ 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 ;

MEMO: static-huffman-tables ( -- obj )
    [
        0 143 [a,b] [ 8 ] replicate
        144 255 [a,b] [ 9 ] replicate append
        256 279 [a,b] [ 7 ] replicate append
        280 287 [a,b] [ 8 ] replicate append
    ] append-outputs
    0 31 [a,b] [ 5 ] replicate 2array
    [ [ length>> [0,b) ] [ ] bi get-table ] map ;

CONSTANT: length-table
    {
