From a9a67e9418361f026eac81bba134017ce43b9684 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 22 Apr 2013 22:46:43 +0200 Subject: [PATCH] Simplify compile Signed-off-by: Julien Danjou --- hy/compiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hy/compiler.py b/hy/compiler.py index 223242e..c1d6178 100644 --- a/hy/compiler.py +++ b/hy/compiler.py @@ -135,9 +135,9 @@ class HyASTCompiler(object): def compile(self, tree): try: - for _type in _compile_table: - if type(tree) == _type: - return _compile_table[_type](self, tree) + _type = type(tree) + if _type in _compile_table: + return _compile_table[_type](self, tree) except HyCompileError: # compile calls compile, so we're going to have multiple raise # nested; so let's re-raise this exception, let's not wrap it in