- HTNode currentNode = getSHT().getRootNode();
- HTInterval interval = currentNode.getRelevantInterval(key, t);
-
- try {
- while (interval == null && currentNode.getNodeType() == HTNode.NodeType.CORE) {
- currentNode = getSHT().selectNextChild((CoreNode) currentNode, t);
- interval = currentNode.getRelevantInterval(key, t);
+ Deque<HTNode> queue = new LinkedList<>();
+ queue.add(getSHT().getRootNode());
+ HTInterval interval = null;
+ while (interval == null && !queue.isEmpty()) {
+ HTNode currentNode = queue.pop();
+ if (currentNode.getNodeType() == HTNode.NodeType.CORE) {
+ queue.addAll(getSHT().selectNextChildren((ParentNode) currentNode, t));