From 59ce436dabb2ad96e3502236a9c7a9b32b787166 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 2 Jan 2017 09:34:15 -0800 Subject: [PATCH] math.combinatorics: cleaner next-permutation. --- basis/math/combinatorics/combinatorics.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/math/combinatorics/combinatorics.factor b/basis/math/combinatorics/combinatorics.factor index 907aab6e2c..efa2d2ee07 100644 --- a/basis/math/combinatorics/combinatorics.factor +++ b/basis/math/combinatorics/combinatorics.factor @@ -153,7 +153,7 @@ HINTS: (next-permutation) array ; PRIVATE> : next-permutation ( seq -- seq ) - dup [ ] [ drop (next-permutation) ] if-empty ; + dup empty? [ (next-permutation) ] unless ; ! Combinadic-based combination methodology