1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Improved readability of utils.datetime_safe._findall().

This commit is contained in:
Srinivas Reddy Thatiparthy 2018-01-02 23:01:06 +05:30 committed by Tim Graham
parent 47a99d7012
commit acd3baf2ae

View File

@ -61,12 +61,12 @@ def _findall(text, substr):
# Also finds overlaps
sites = []
i = 0
while 1:
j = text.find(substr, i)
if j == -1:
while True:
i = text.find(substr, i)
if i == -1:
break
sites.append(j)
i = j + 1
sites.append(i)
i += 1
return sites