]> gitweb.factorcode.org Git - factor.git/commitdiff
Remove use of 'rot' in uuid.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 21 Dec 2008 03:32:16 +0000 (19:32 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 21 Dec 2008 03:32:16 +0000 (19:32 -0800)
basis/uuid/uuid.factor

index d666ef3ae797e1c76eb09551690fa0d8595523fc..8b491d7cf2e9309d4113248ebf4c964e35c0e624 100644 (file)
@@ -51,10 +51,10 @@ IN: uuid
     [ CHAR: - = not ] filter 16 base> ;
 
 : uuid>byte-array ( n -- byte-array ) 
-    16 <byte-array> swap 15 -1 [a,b) [ 
-        rot [ dup HEX: ff bitand ] 2dip 
-        [ set-nth ] keep swap -8 shift 
-    ] each drop ;
+    16 <byte-array> 15 -1 [a,b) [ 
+        [ dup HEX: ff bitand ] 2dip swap
+        [ set-nth -8 shift ] keep 
+    ] each nip ;
 
 : byte-array>uuid ( byte-array -- n )
      0 swap [ [ 8 shift ] dip + ] each ;