Skip to content
Myr

improved wordcount by removing pointless test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Priit Laes · committed by Priit Laes · parent 8464ab1 · Browse files · 1 file+1 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−3 removed

  • other:+1 added−3 removed

1 file+1 added−3 removed

modified:jinja2/filters.py+1 added-3 removed
372 unmodified lines
373 (line, u' \n'[(len(line)-line.rfind('\n') - 1 +374 len(word.split('\n', 1)[0]) >= pos)],375 word), s.split(' '))376377377def do_wordcount(s):378 """Count the words in that string."""380 return len(x for x in s.split() if x)379 return len(s.split())380382381def do_int(value, default=0):382 """Convert the value into an integer. If the383 conversion doesn't work it will return ``0``. You can384 override this default using the first parameter.
231 unmodified lines