From 8708b6014c8217f33e8f46386fcf945145367eba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Tue, 16 May 2023 13:31:18 +0200
Subject: [PATCH] refactor: rename Nub.allChildNubIterator() to
 directChildNubIterator()

refs #302
---
 src/nub.ts         | 6 +++---
 src/pab/pab.ts     | 4 ++--
 src/util/result.ts | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/nub.ts b/src/nub.ts
index e40d9c23..82ffd8f3 100644
--- a/src/nub.ts
+++ b/src/nub.ts
@@ -569,7 +569,7 @@ export abstract class Nub extends ComputeNode implements IProperties {
         stats = this._result.resultElementsLogStats(0, stats);
 
         let sn = 1;
-        const it = this.allChildNubIterator();
+        const it = this.directChildNubIterator();
         let icn = it.next();
         while (!icn.done) {
             stats = icn.value.result.resultElementsLogStats(sn++, stats);
@@ -737,9 +737,9 @@ export abstract class Nub extends ComputeNode implements IProperties {
     }
 
     /**
-     * @returns iterator on all child nubs (may include extra nubs, see Pab nub)
+     * @returns iterator on direct child nubs (may include extra nubs, see Pab nub)
      */
-    public allChildNubIterator() {
+    public directChildNubIterator() {
         return this._children[Symbol.iterator]();
     }
 
diff --git a/src/pab/pab.ts b/src/pab/pab.ts
index f197cd54..727ea249 100644
--- a/src/pab/pab.ts
+++ b/src/pab/pab.ts
@@ -36,9 +36,9 @@ export class Pab extends FishPass {
 
     /**
     * @returns iterator on all child nubs (may include extra nubs, see Pab nub)
-    * @see Nub.allChildNubIterator()
+    * @see Nub.directChildNubIterator()
     */
-    public allChildNubIterator() {
+    public directChildNubIterator() {
         // clone children array
         const arr = Object.assign([], this.children);
         // append wall at downstream
diff --git a/src/util/result.ts b/src/util/result.ts
index c84150b3..a396c11a 100644
--- a/src/util/result.ts
+++ b/src/util/result.ts
@@ -132,7 +132,7 @@ export class Result extends JalhydObject {
         if (re !== undefined) {
             res.push(re);
         }
-        const it: Iterator<Nub> = this._sourceNub.allChildNubIterator();
+        const it: Iterator<Nub> = this._sourceNub.directChildNubIterator();
         let inub = it.next()
         while (!inub.done) {
             let re = inub.value.result._resultElements[index];
@@ -289,7 +289,7 @@ export class Result extends JalhydObject {
         }
 
         if (recurs && this._sourceNub !== undefined) {
-            for (const n of this._sourceNub.allChildNubIterator()) {
+            for (const n of this._sourceNub.directChildNubIterator()) {
                 if (n.result.hasMessage(code, true)) {
                     return true;
                 }
-- 
GitLab