/// <summary> /// calls iterator for drill down and manages its return path via a stack /// </summary> /// <param name="istate"></param> /// <returns></returns> private bool Process(IteratorState istate) { // stack and one-way (drill down) recursion: IEnumerator <ISubsumptionTask> iterator2 = this.iterate(istate.iterator); if (iterator2 == null) { istate.iterator = istate.stack.Count > 0 ? istate.stack.Pop() : null; } else if (iterator2 != istate.iterator) { istate.stack.Push(istate.iterator); istate.iterator = iterator2; } return(istate.iterator != null); }
/// <summary> /// calls iterator for drill down and manages its return path via a stack /// </summary> /// <param name="istate"></param> /// <returns></returns> private bool Process(IteratorState istate) { // stack and one-way (drill down) recursion: IEnumerator<ISubsumptionTask> iterator2 = this.iterate(istate.iterator); if (iterator2 == null) { istate.iterator = istate.stack.Count > 0 ? istate.stack.Pop() : null; } else if (iterator2 != istate.iterator) { istate.stack.Push(istate.iterator); istate.iterator = iterator2; } return istate.iterator != null; }