From fee1ce2a4705e87a0151bf57f5bd60110225b7c6 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Mon, 19 Oct 2020 17:00:12 -0700 Subject: [PATCH] Minor code rearrangement Signed-off-by: Alek Ratzloff --- src/compile/thunk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile/thunk.rs b/src/compile/thunk.rs index 9143ce6..f48e584 100644 --- a/src/compile/thunk.rs +++ b/src/compile/thunk.rs @@ -418,7 +418,6 @@ impl Visit for CompileBody<'_> { fn visit_atom(&mut self, atom: &Atom) -> Self::Out { let thunk = match atom { Atom::Ident(ident) => { - let sym = global_sym(ident.to_string()); // Small gotcha: // Looking up a name will either result in a local or a global lookup. If it's // a local variable first, then it's determined as a local and that's the end @@ -427,6 +426,7 @@ impl Visit for CompileBody<'_> { // // This checks to make sure that it's both a local variable and that there's more // than one scope layer. + let sym = global_sym(ident.to_string()); if let (true, Some(local)) = (self.compile.scope().layers_len() > 1, self.compile.lookup_local(sym)) { // get local Inst::LoadLocal(local).into()