From: floguy Date: Mon, 8 Sep 2008 07:05:05 +0000 (+0000) Subject: Removed some redundant uses of sorted(list(..)) to be just sorted(..). X-Git-Tag: 1.0.6~24 X-Git-Url: https://git.mdrn.pl/django-pagination.git/commitdiff_plain/e7a1078a8180e3ce92e6a5fd168bcb82b9e2f9c9?ds=sidebyside;hp=-c Removed some redundant uses of sorted(list(..)) to be just sorted(..). git-svn-id: https://django-pagination.googlecode.com/svn/trunk@33 7f1efe38-554e-0410-b69d-834cb44da2d5 --- e7a1078a8180e3ce92e6a5fd168bcb82b9e2f9c9 diff --git a/pagination/templatetags/pagination_tags.py b/pagination/templatetags/pagination_tags.py index e2e5bb3..55bbb13 100644 --- a/pagination/templatetags/pagination_tags.py +++ b/pagination/templatetags/pagination_tags.py @@ -122,8 +122,8 @@ def paginate(context, window=DEFAULT_WINDOW): # If there's no overlap between the first set of pages and the current # set of pages, then there's a possible need for elusion. if len(first.intersection(current)) == 0: - first_list = sorted(list(first)) - second_list = sorted(list(current)) + first_list = sorted(first) + second_list = sorted(current) pages.extend(first_list) diff = second_list[0] - first_list[-1] # If there is a gap of two, between the last page of the first @@ -141,11 +141,11 @@ def paginate(context, window=DEFAULT_WINDOW): pages.append(None) pages.extend(second_list) else: - pages.extend(sorted(list(first.union(current)))) + pages.extend(sorted(first.union(current))) # If there's no overlap between the current set of pages and the last # set of pages, then there's a possible need for elusion. if len(current.intersection(last)) == 0: - second_list = sorted(list(last)) + second_list = sorted(last) diff = second_list[0] - pages[-1] # If there is a gap of two, between the last page of the current # set and the first page of the last set, then we're missing a @@ -162,7 +162,7 @@ def paginate(context, window=DEFAULT_WINDOW): pages.append(None) pages.extend(second_list) else: - pages.extend(sorted(list(last.difference(current)))) + pages.extend(sorted(last.difference(current))) to_return = { 'pages': pages, 'page_obj': page_obj,