From 62dbdb79dd37c1d0dfc0aa5d0d6556a3a20f2cab Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 28 Jun 2015 00:21:25 +0900 Subject: [PATCH] cleanup --- extlib/benz/codegen.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/extlib/benz/codegen.c b/extlib/benz/codegen.c index c7fd6feb..40ce6bad 100644 --- a/extlib/benz/codegen.c +++ b/extlib/benz/codegen.c @@ -345,23 +345,15 @@ search_scope(analyze_scope *scope, pic_sym *sym) return kh_get(a, &scope->args, sym) != kh_end(&scope->args) || kh_get(a, &scope->locals, sym) != kh_end(&scope->locals) || scope->depth == 0; } -static void -capture_var(pic_state *pic, analyze_scope *scope, pic_sym *sym) -{ - int ret; - - kh_put(a, &scope->captures, sym, &ret); -} - static int find_var(pic_state *pic, analyze_scope *scope, pic_sym *sym) { - int depth = 0; + int depth = 0, ret; while (scope) { if (search_scope(scope, sym)) { if (depth > 0) { - capture_var(pic, scope, sym); + kh_put(a, &scope->captures, sym, &ret); /* capture! */ } return depth; }