From d6a93b06f2de527b334f4e09e98417b1944da98b Mon Sep 17 00:00:00 2001 From: Larry Wall Date: Thu, 30 Jan 2014 15:02:46 -0800 Subject: [PATCH] fix for .combinations timeout --- src/core/List.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/List.pm b/src/core/List.pm index ae7ef141966..a046a526f85 100644 --- a/src/core/List.pm +++ b/src/core/List.pm @@ -4,8 +4,10 @@ my class X::TypeCheck { ... } my sub combinations($n, $k) { my @result; my @stack; - @stack.push(0); + return () unless $k; + + @stack.push(0); gather while @stack { my $index = @stack - 1; my $value = @stack.pop;