Skip to content

Commit a8d5c24

Browse files
author
Ralf Schlatterbeck
committed
optimize parsing of sort/group options according to suggestion...
...from alexander smishlajev
1 parent 8ebe420 commit a8d5c24

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

roundup/cgi/templating.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ def _parse_sort(self, var, name):
21352135
'''
21362136
fields = []
21372137
dirs = []
2138-
for special in ':@':
2138+
for special in '@:':
21392139
idx = 0
21402140
key = '%s%s%d'%(special, name, idx)
21412141
while key in self.form:
@@ -2155,9 +2155,7 @@ def _parse_sort(self, var, name):
21552155
fields = handleListCGIValue(self.form[key])
21562156
if dirkey in self.form:
21572157
dirs.append(self.form[dirkey].value)
2158-
else:
2159-
dirs.append(None)
2160-
if fields:
2158+
if fields: # only try other special char if nothing found
21612159
break
21622160
for f, d in map(None, fields, dirs):
21632161
if f.startswith('-'):

0 commit comments

Comments
 (0)