From 3f4b3c3f4c0ed09dfd70f94abc78be4e10857549 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 7 Mar 2014 02:03:12 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util.py') diff --git a/src/util.py b/src/util.py index d42515b..ef7cd52 100644 --- a/src/util.py +++ b/src/util.py @@ -95,10 +95,10 @@ def reduce(f, items): @param f:(¿E?, ¿E?)→¿E? The function @param item:itr<¿E?> The input - @return ¿E? The output + @return ¿E?? The output, `None` if `item` is empty ''' - if len(items) < 2: - return [] if len(items) == 0 else items[0] + if len(items) == 0: + return None rc = items[0] for i in range(1, len(items)): rc = f(rc, items[i]) -- cgit v1.2.3-70-g09d2