From 4e103a7d0be6bf1e3cd0ed39934afb36e525a243 Mon Sep 17 00:00:00 2001 From: David Vazquez Date: Mon, 11 Feb 2013 01:35:21 +0000 Subject: [PATCH] Avoid 'var i;' if the function does not use keyword arguments --- ecmalisp.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ecmalisp.lisp b/ecmalisp.lisp index 76ab4a6..149a777 100644 --- a/ecmalisp.lisp +++ b/ecmalisp.lisp @@ -1412,7 +1412,6 @@ (keyword-arguments (lambda-list-keyword-arguments-canonical lambda-list))) (code - "var i;" *newline* ;; Declare variables (mapconcat (lambda (arg) (let ((var (second (car arg)))) @@ -1439,7 +1438,9 @@ (ls-compile (cadr keyarg)) ";" *newline*) "}" *newline*))) - (mapconcat #'parse-keyword keyword-arguments)) + (when keyword-arguments + (code "var i;" *newline* + (mapconcat #'parse-keyword keyword-arguments)))) ;; Check for unknown keywords (when keyword-arguments (code "for (i=" (+ 1 n-required-arguments n-optional-arguments) -- 1.7.10.4