From 284f200ab1803ff10757131ba63f06dd9bbe161d Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Thu, 17 Apr 2008 21:22:00 +0200 Subject: [PATCH] improved wordcount by removing pointless test --HG-- branch : trunk --- jinja2/filters.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/jinja2/filters.py b/jinja2/filters.py index fd3d66f..633dbdf 100644 --- a/jinja2/filters.py +++ b/jinja2/filters.py @@ -374,11 +374,9 @@ def do_wordwrap(s, pos=79, hard=False): len(word.split('\n', 1)[0]) >= pos)], word), s.split(' ')) - def do_wordcount(s): """Count the words in that string.""" - return len(x for x in s.split() if x) - + return len(s.split()) def do_int(value, default=0): """Convert the value into an integer. If the -- 2.26.2