]> gitweb.factorcode.org Git - factor.git/commitdiff
db.tuples: simplify count-tuples.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 14 Feb 2018 18:39:55 +0000 (10:39 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 14 Feb 2018 18:39:55 +0000 (10:39 -0800)
basis/db/tuples/tuples.factor

index 7a8d6e567445527329098de49ff7c94fdb36eaa5..76bba72dbefc7c3f5e7f4ed67429f0cd0dd62a50 100644 (file)
@@ -154,5 +154,4 @@ ERROR: no-defined-persistent object ;
 
 : count-tuples ( query/tuple -- n )
     >query [ tuple>> ] [ <count-statement> ] bi do-count
-    dup length 1 =
-    [ first first string>number ] [ [ first string>number ] map ] if ;
+    [ first string>number ] map dup length 1 = [ first ] when ;