From: Priit Laes Date: Thu, 17 Apr 2008 19:22:00 +0000 (+0200) Subject: improved wordcount by removing pointless test X-Git-Tag: 2.0rc1~151 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=284f200ab1803ff10757131ba63f06dd9bbe161d;p=jinja2.git improved wordcount by removing pointless test --HG-- branch : trunk --- 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