mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #28860 -- Removed unnecessary len() calls.
This commit is contained in:
committed by
Tim Graham
parent
3d94ee8500
commit
d2afa5eb23
@@ -568,7 +568,7 @@ def slice_filter(value, arg):
|
||||
try:
|
||||
bits = []
|
||||
for x in arg.split(':'):
|
||||
if len(x) == 0:
|
||||
if not x:
|
||||
bits.append(None)
|
||||
else:
|
||||
bits.append(int(x))
|
||||
|
||||
@@ -715,7 +715,7 @@ def firstof(parser, token):
|
||||
"""
|
||||
bits = token.split_contents()[1:]
|
||||
asvar = None
|
||||
if len(bits) < 1:
|
||||
if not bits:
|
||||
raise TemplateSyntaxError("'firstof' statement requires at least one argument")
|
||||
|
||||
if len(bits) >= 2 and bits[-2] == 'as':
|
||||
@@ -1363,7 +1363,7 @@ def url(parser, token):
|
||||
asvar = bits[-1]
|
||||
bits = bits[:-2]
|
||||
|
||||
if len(bits):
|
||||
if bits:
|
||||
for bit in bits:
|
||||
match = kwarg_re.match(bit)
|
||||
if not match:
|
||||
|
||||
Reference in New Issue
Block a user