Author: henning Date: Tue Aug 15 05:26:17 2006 New Revision: 431584 URL: http://svn.apache.org/viewvc?rev=431584&view=rev Log: Do some micro optimizations courtesy to Kevin Jackson @ AC Asia. Cleared by Rony, Sanka and Nandika. They made me check it in. :-)
Modified: jakarta/bsf/trunk/src/org/apache/bsf/engines/javascript/JavaScriptEngine.java Modified: jakarta/bsf/trunk/src/org/apache/bsf/engines/javascript/JavaScriptEngine.java URL: http://svn.apache.org/viewvc/jakarta/bsf/trunk/src/org/apache/bsf/engines/javascript/JavaScriptEngine.java?rev=431584&r1=431583&r2=431584&view=diff ============================================================================== --- jakarta/bsf/trunk/src/org/apache/bsf/engines/javascript/JavaScriptEngine.java (original) +++ jakarta/bsf/trunk/src/org/apache/bsf/engines/javascript/JavaScriptEngine.java Tue Aug 15 05:26:17 2006 @@ -16,6 +16,7 @@ package org.apache.bsf.engines.javascript; +import java.util.Iterator; import java.util.Vector; import org.apache.bsf.BSFDeclaredBean; @@ -28,7 +29,6 @@ import org.mozilla.javascript.ImporterTopLevel; import org.mozilla.javascript.JavaScriptException; import org.mozilla.javascript.NativeJavaObject; -import org.mozilla.javascript.Script; import org.mozilla.javascript.ScriptRuntime; import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.WrappedException; @@ -122,7 +122,6 @@ String scriptText = oscript.toString(); Object retval = null; - Script script; Context cx; try { @@ -214,9 +213,8 @@ Scriptable bsf = Context.toObject(new BSFFunctions(mgr, this), global); global.put("bsf", global, bsf); - int size = declaredBeans.size(); - for (int i = 0; i < size; i++) { - declareBean((BSFDeclaredBean) declaredBeans.elementAt(i)); + for(Iterator it = declaredBeans.iterator(); it.hasNext();) { + declareBean((BSFDeclaredBean) it.next()); } } catch (Throwable t) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]