From: David Vazquez Date: Mon, 11 Feb 2013 01:35:21 +0000 (+0000) Subject: Avoid 'var i;' if the function does not use keyword arguments X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=4e103a7d0be6bf1e3cd0ed39934afb36e525a243;p=jscl.git Avoid 'var i;' if the function does not use keyword arguments --- 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)