]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/base64/base64.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / base64 / base64.factor
index 111fe49f9567efd0db0ab3b6dddcc2e48b3580da..eb2c9193a374b35e61a33a2f510f4c2582eaf04e 100644 (file)
@@ -5,6 +5,8 @@ io.streams.byte-array kernel math namespaces
 sequences strings io.crlf ;
 IN: base64
 
+ERROR: malformed-base64 ;
+
 <PRIVATE
 
 : read1-ignoring ( ignoring -- ch )
@@ -18,8 +20,6 @@ IN: base64
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
     nth ; inline
 
-ERROR: malformed-base64 ;
-
 : base64>ch ( ch -- ch )
     {
         f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f
@@ -34,7 +34,7 @@ SYMBOL: column
 : write1-lines ( ch -- )
     write1
     column get [
-        1+ [ 76 = [ crlf ] when ]
+        1 + [ 76 = [ crlf ] when ]
         [ 76 mod column set ] bi
     ] when* ;
 
@@ -48,7 +48,7 @@ SYMBOL: column
 
 : encode-pad ( seq n -- )
     [ 3 0 pad-tail binary [ encode3 ] with-byte-writer ]
-    [ 1+ ] bi* head-slice 4 CHAR: = pad-tail write-lines ; inline
+    [ 1 + ] bi* head-slice 4 CHAR: = pad-tail write-lines ; inline
 
 : decode4 ( seq -- )
     [ 0 [ base64>ch swap 6 shift bitor ] reduce 3 >be ]