- From: Yoshisato Yanagisawa <notifications@github.com>
- Date: Sun, 02 Feb 2025 22:29:54 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/pull/1752/review/2589008823@github.com>
@yoshisatoyanagisawa commented on this pull request.
> + <h3 id="count-router-inner-conditions"><dfn>Count Router Inner Conditions</dfn></h3>
+
+ : Input
+ :: |condition|, a {{RouterCondition}}
+ :: |result|, a [=count router condition result=]
+ :: |maxCount|, a number
+ :: |maxDepth|, a number
+ : Output
+ :: |result|, a [=count router condition result=]
+
+ 1. Increment |result|'s [=count router condition result/total count=] by one.
+ 1. If |result|'s [=count router condition result/total count=] exceeds |maxCount|, return |result|.
+ 1. If |result|'s [=count router condition result/depth=] exceeds |maxDepth|, return |result|.
+ 1. If |condition|["{{RouterCondition/_or}}"] [=map/exists=], then:
+ 1. Increment |result|'s [=count router condition result/depth=] by one.
+ 1. For each |orCondition| of |condition|["{{RouterCondition/_or}}"]:
Upon the sync, I understand how this works.
The last result will be the |currentResult|'s total count, and it will be passed to the coming count-router-inner-conditions. Therefore, the value will be updated like:
1. |currentResult| is passed to count-router-inner-conditions's argument
2. in the count-router-inner-conditions, the given argument will be updated
3. the updated value will be returned
4. |currentResult|'s total count will be set to the returned result's total count.
Therefore, even if the algorithm does not have add x + y like operation, the count will be updated.
I feel the data flow is difficult to track at once, and hope some notes to explain that as you have already noted below.
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1752#discussion_r1938841732
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/pull/1752/review/2589008823@github.com>
Received on Monday, 3 February 2025 06:29:57 UTC