]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/project-euler/079/079.factor
if-empty changes
[factor.git] / extra / project-euler / 079 / 079.factor
index f64c345694d5690280d3b1ba548873fd79b22df3..1e6a2fb0b477be3526e97cb8b91db01f0dbd6295 100644 (file)
@@ -36,7 +36,7 @@ IN: project-euler.079
 
 : find-source ( seq -- elt )
     unzip diff prune
-    dup empty? [ "Topological sort failed" throw ] [ first ] if ;
+    [ "Topological sort failed" throw ] [ first ] if-empty ;
 
 : remove-source ( seq elt -- seq )
     [ swap member? not ] curry filter ;
@@ -45,7 +45,7 @@ IN: project-euler.079
     dup length 1 > [
         dup find-source dup , remove-source (topological-sort)
     ] [
-        dup empty? [ drop ] [ first [ , ] each ] if
+        [ first [ , ] each ] unless-empty
     ] if ;
 
 PRIVATE>