projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00a5ade
)
generate switch-case characters in sorted order for 'char_val in bytes'
author
Stefan Behnel
<scoder@users.berlios.de>
Thu, 22 Apr 2010 10:27:49 +0000
(12:27 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Thu, 22 Apr 2010 10:27:49 +0000
(12:27 +0200)
Cython/Compiler/Optimize.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Optimize.py
b/Cython/Compiler/Optimize.py
index f2d55a69e78ec68ca361304f1a5a05c3eaddeebc..6d3943166c542fbf05804d39600245f75dfbaa82 100644
(file)
--- a/
Cython/Compiler/Optimize.py
+++ b/
Cython/Compiler/Optimize.py
@@
-644,7
+644,8
@@
class SwitchTransform(Visitor.VisitorTransform):
# integers on iteration, whereas Py2 returns 1-char byte
# strings
characters = string_literal.value
- characters = set([ characters[i:i+1] for i in range(len(characters)) ])
+ characters = list(set([ characters[i:i+1] for i in range(len(characters)) ]))
+ characters.sort()
return [ ExprNodes.CharNode(string_literal.pos, value=charval,
constant_result=charval)
for charval in characters ]