c2.setCurrentIterator(iter);
c2.setCurrentTemplateRule(null);
if (containsTailCall) {
if (LogConfiguration.loggingIsEnabled() && LogController.traceIsEnabled()) {
TraceListener listener = LogController.getTraceListener();
Item item = iter.next();
if (item == null) {
return null;
}
listener.startCurrentItem(item);
TailCall tc = ((TailCallReturner)action).processLeavingTail(c2);
listener.endCurrentItem(item);
return tc;
} else {
Item item = iter.next();
if (item == null) {
return null;
}
}
return ((TailCallReturner)action).processLeavingTail(c2);
} else {
if (LogConfiguration.loggingIsEnabled() && LogController.traceIsEnabled()) {
TraceListener listener = LogController.getTraceListener();
while(true) {
Item item = iter.next();
if (item == null) {
break;
}
listener.startCurrentItem(item);
action.process(c2);
listener.endCurrentItem(item);
}
} else {
while(true) {
Item item = iter.next();
if (item == null) {