Author: sebb
Date: Sat Aug  1 03:22:48 2009
New Revision: 799793

URL: http://svn.apache.org/viewvc?rev=799793&view=rev
Log:
More efficient: 
- don't fetch value twice
- no need to check for null when we would just return null anyway

Modified:
    
jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java

Modified: 
jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java
URL: 
http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java?rev=799793&r1=799792&r2=799793&view=diff
==============================================================================
--- 
jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java
 (original)
+++ 
jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleScriptContext.java
 Sat Aug  1 03:22:48 2009
@@ -96,9 +96,10 @@
 
         checkName(name);
 
-        if (engineScope.get(name) != null) {
-            return engineScope.get(name);
-        } else if (globalScope != null && globalScope.get(name) != null) {
+        final Object engineObject = engineScope.get(name);
+        if (engineObject != null) {
+            return engineObject;
+        } else if (globalScope != null) {
             return globalScope.get(name);
         } else {
             return null;            



---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: bsf-dev-h...@jakarta.apache.org

Reply via email to