You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by vi...@apache.org on 2009/08/27 19:06:28 UTC

svn commit: r808532 - /incubator/vxquery/trunk/vxquery/src/main/org/apache/vxquery/runtime/core/IfThenElseIterator.java

Author: vinayakb
Date: Thu Aug 27 17:06:27 2009
New Revision: 808532

URL: http://svn.apache.org/viewvc?rev=808532&view=rev
Log:
Minor refactoring

Modified:
    incubator/vxquery/trunk/vxquery/src/main/org/apache/vxquery/runtime/core/IfThenElseIterator.java

Modified: incubator/vxquery/trunk/vxquery/src/main/org/apache/vxquery/runtime/core/IfThenElseIterator.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/org/apache/vxquery/runtime/core/IfThenElseIterator.java?rev=808532&r1=808531&r2=808532&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/org/apache/vxquery/runtime/core/IfThenElseIterator.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/org/apache/vxquery/runtime/core/IfThenElseIterator.java Thu Aug 27 17:06:27 2009
@@ -1,19 +1,19 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.vxquery.runtime.core;
 
 import org.apache.vxquery.datamodel.atomic.BooleanValue;
@@ -47,7 +47,7 @@
     public void close(CallStackFrame frame) {
         Boolean c = condition.get(frame);
         if (c != null) {
-            (c ? ti : ei).close(frame);
+            getResultIterator(c).close(frame);
         }
     }
 
@@ -57,9 +57,13 @@
         if (c == null) {
             c = getConditionResult(frame);
             condition.set(frame, c);
-            (c ? ti : ei).open(frame);
+            getResultIterator(c).open(frame);
         }
-        return (c ? ti : ei).next(frame);
+        return getResultIterator(c).next(frame);
+    }
+
+    private RuntimeIterator getResultIterator(Boolean c) {
+        return c ? ti : ei;
     }
 
     @Override