projects
/
jinja2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8464ab1
)
improved wordcount by removing pointless test
author
Priit Laes
<plaes@plaes.org>
Thu, 17 Apr 2008 19:22:00 +0000
(21:22 +0200)
committer
Priit Laes
<plaes@plaes.org>
Thu, 17 Apr 2008 19:22:00 +0000
(21:22 +0200)
--HG--
branch : trunk
jinja2/filters.py
patch
|
blob
|
history
diff --git
a/jinja2/filters.py
b/jinja2/filters.py
index fd3d66fa49b89b0f0e667967562fd27dc05089f5..633dbdf8bcfecc81ddd2d574f37830641c5f08b1 100644
(file)
--- 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