1
0
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:
Дилян Палаузов
2017-11-29 11:54:34 -05:00
committed by Tim Graham
parent 3d94ee8500
commit d2afa5eb23
33 changed files with 56 additions and 55 deletions

View File

@@ -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))

View File

@@ -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: