[web/facet] Simplify reversed/sorted calls
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 14 Sep 2015 15:42:38 +0200
changeset 10597 44c52385d2d8
parent 10596 3a7ce5c9fe35
child 10598 b3f9f929385f
[web/facet] Simplify reversed/sorted calls
web/facet.py
--- a/web/facet.py	Mon Sep 28 13:47:30 2015 +0200
+++ b/web/facet.py	Mon Sep 14 15:42:38 2015 +0200
@@ -922,9 +922,7 @@
         if self.rql_sort:
             return [(_(value), value) for value, in rset]
         values = [(_(value), value) for value, in rset]
-        if self.sortasc:
-            return sorted(values)
-        return reversed(sorted(values))
+        return sorted(values, reverse=not self.sortasc)
 
 
 class AttributeFacet(RelationAttributeFacet):