Skip to content

Commit

Permalink
Remove unnecessary call to len (fixes #424)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyve committed May 1, 2018
1 parent ed5b2c8 commit 45ce912
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions bootstrap3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,16 @@ def parse_token_contents(parser, token):
if len(bits) >= 2 and bits[-2] == 'as':
asvar = bits[-1]
bits = bits[:-2]
if len(bits):
for bit in bits:
match = kwarg_re.match(bit)
if not match:
raise TemplateSyntaxError(
'Malformed arguments to tag "{}"'.format(tag))
name, value = match.groups()
if name:
kwargs[name] = parser.compile_filter(value)
else:
args.append(parser.compile_filter(value))
for bit in bits:
match = kwarg_re.match(bit)
if not match:
raise TemplateSyntaxError(
'Malformed arguments to tag "{}"'.format(tag))
name, value = match.groups()
if name:
kwargs[name] = parser.compile_filter(value)
else:
args.append(parser.compile_filter(value))
return {
'tag': tag,
'args': args,
Expand Down

0 comments on commit 45ce912

Please sign in to comment.