improved wordcount by removing pointless test
authorPriit Laes <plaes@plaes.org>
Thu, 17 Apr 2008 19:22:00 +0000 (21:22 +0200)
committerPriit Laes <plaes@plaes.org>
Thu, 17 Apr 2008 19:22:00 +0000 (21:22 +0200)
--HG--
branch : trunk

jinja2/filters.py

index fd3d66fa49b89b0f0e667967562fd27dc05089f5..633dbdf8bcfecc81ddd2d574f37830641c5f08b1 100644 (file)
@@ -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