diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2018-09-23 16:02:46 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2018-09-23 16:02:46 +0200 |
commit | fac68977709b369115a96b42cce61029dcfe64d3 (patch) | |
tree | 58d1c96fe36d0fca4198154ee9f9c18d8b4b1c39 /Cython | |
parent | 6260f48709d0781a9824c851742f5b945b1baf85 (diff) | |
download | cython-fac68977709b369115a96b42cce61029dcfe64d3.tar.gz |
Simplify some code.
Diffstat (limited to 'Cython')
-rw-r--r-- | Cython/Compiler/Nodes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 0d72024a9..9bbd7bb2f 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -6337,10 +6337,10 @@ class SwitchCaseNode(StatNode): def generate_execution_code(self, code): num_conditions = len(self.conditions) line_tracing_enabled = code.globalstate.directives['linetrace'] - for i, cond in enumerate(self.conditions): + for i, cond in enumerate(self.conditions, 1): code.putln("case %s:" % cond.result()) code.mark_pos(cond.pos) # Tracing code must appear *after* the 'case' statement. - if line_tracing_enabled and i + 1 < num_conditions: + if line_tracing_enabled and i < num_conditions: # Allow fall-through after the line tracing code. code.putln('CYTHON_FALLTHROUGH;') self.body.generate_execution_code(code) |