]> gitweb.factorcode.org Git - factor.git/commitdiff
basis/extra: use remove in a few places
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 3 Jan 2022 20:32:55 +0000 (12:32 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 3 Jan 2022 20:32:55 +0000 (12:32 -0800)
basis/unicode/data/data.factor
basis/uuid/uuid.factor
basis/xml/tests/test.factor
basis/xml/writer/writer.factor
extra/macho/macho.factor
extra/totp/totp.factor

index cc13236411830d96343bd56bdf02164eced6ee36..555b4db55f9747382f65acade3f0523e1e816d53 100644 (file)
@@ -108,7 +108,7 @@ PRIVATE>
 : exclusions ( -- set )
     exclusions-file utf8 file-lines
     [ "#" split1 drop [ ascii:blank? ] trim-tail hex> ] map
-    [ 0 = ] reject ;
+    0 swap remove ;
 
 : unique ( seq -- assoc )
     [ dup ] H{ } map>assoc ;
index 818219192e82379709d649681602bc0a5bfed16f..2887f73852f1f2292f4c83d5e393fccabf7db679 100644 (file)
@@ -48,7 +48,7 @@ IN: uuid
     [ CHAR: - 8 ] dip insert-nth ;
 
 : string>uuid ( string -- n )
-    [ CHAR: - = ] reject hex> ;
+    CHAR: - swap remove hex> ;
 
 PRIVATE>
 
index 57d89baaf0d127050d58f44e8a93db5ac415d4cf..e8ece4fad68cf96ac1818931ed8a91d2866bfdba 100644 (file)
@@ -57,7 +57,7 @@ SYMBOL: xml-file
 [ ] [ "<?xml version='1.0'?><!-- declarations for <head> & <body> --><foo/>" string>xml drop ] unit-test
 
 : first-thing ( seq -- elt )
-    [ "" = ] reject first ;
+    "" swap remove first ;
 
 [ T{ element-decl f "br" "EMPTY" } ] [ "<!ELEMENT br EMPTY>" string>dtd directives>> first-thing ] unit-test
 [ T{ element-decl f "p" "(#PCDATA|emph)*" } ] [ "<!ELEMENT p (#PCDATA|emph)*>" string>dtd directives>> first-thing ] unit-test
index b4f9c3be61cbc8fad4ae20736bc802eee66f3ea9..cdb849b2340ec7f61c0207157bd98dd8e24ff188 100644 (file)
@@ -34,7 +34,7 @@ SYMBOL: indentation
 : ?filter-children ( children -- no-whitespace )
     xml-pprint? get [
         [ dup string? [ [ blank? ] trim ] when ] map
-        [ "" = ] reject
+        "" swap remove
     ] when ;
 
 PRIVATE>
index f404317123fcc93e04e37b31b631ee51e192dcef..557571962fe390f4583541730f221583b99394dc 100644 (file)
@@ -944,7 +944,7 @@ TYPED: load-commands ( macho: mach_header_32/64 -- load-commands )
     [ symtab_command? ] filter ; inline
 
 : read-array-string ( uchar-array -- string )
-    ascii decode [ 0 = ] reject ;
+    ascii decode 0 swap remove ;
 
 : segment-sections ( segment-command -- sections )
     {
index 55f93f01f9d963b2fa6ddb386ce8823feda85dad..3b35272a7962164b64b9c0c013e388cd79b92a5d 100644 (file)
@@ -29,5 +29,5 @@ PRIVATE>
     [ number>string ] dip [ CHAR: 0 pad-head ] keep tail* ;
 
 : totp ( key -- string )
-    dup string? [ [ CHAR: space = ] reject >upper base32> ] when
+    dup string? [ CHAR: space swap remove >upper base32> ] when
     now timestamp>count swap totp-hash get totp* totp-digits get digits ;