File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ const findIntersections = (setsByKey, options) => {
145145 * @property {Map<bigint, Set<T>[]> } intersectionsByOriginalKey additional subsets by original set key
146146 * @property {number } checks the number of possible containing sets checked
147147 * @property {number } comparisons the maximum number of membership checks performed
148- * @property {number } expansions the weighted number of downstream visits
148+ * @property {number } expansions the weighted number of downstream item visits
149149 * @property {boolean } limited whether propagation reached a limit
150150 */
151151
@@ -230,9 +230,12 @@ const associateIntersections = (
230230 checks ++ ;
231231 comparisons += intersection . size ;
232232 if ( isSubset ( original , intersection ) ) {
233+ // Each module occurrence can visit every selected chunk, including
234+ // calls through a configured chunks filter.
233235 const weightedExpansions =
234236 candidateExpansions +
235- /** @type {number } */ ( originalWeightsByKey . get ( key ) ) ;
237+ /** @type {number } */ ( originalWeightsByKey . get ( key ) ) *
238+ intersection . size ;
236239 if ( expansions + weightedExpansions > maximumExpansions ) {
237240 limited = true ;
238241 break search;
Original file line number Diff line number Diff line change @@ -155,15 +155,15 @@ describe("SetHelpers", () => {
155155 {
156156 maximumChecks : 10 ,
157157 maximumComparisons : 10 ,
158- maximumExpansions : 10
158+ maximumExpansions : 20
159159 }
160160 ) ;
161161 expect ( result . intersectionsByOriginalKey . get ( matchingKey ) ) . toEqual ( [
162162 new Set ( [ 1 , 2 ] )
163163 ] ) ;
164164 expect ( result . checks ) . toBe ( 1 ) ;
165165 expect ( result . comparisons ) . toBe ( 2 ) ;
166- expect ( result . expansions ) . toBe ( 7 ) ;
166+ expect ( result . expansions ) . toBe ( 14 ) ;
167167 expect ( result . limited ) . toBe ( false ) ;
168168 } ) ;
169169
@@ -181,7 +181,7 @@ describe("SetHelpers", () => {
181181 {
182182 maximumChecks : 10 ,
183183 maximumComparisons : 10 ,
184- maximumExpansions : 1
184+ maximumExpansions : 2
185185 }
186186 ) ;
187187 expect ( result . intersectionsByOriginalKey . size ) . toBe ( 0 ) ;
You can’t perform that action at this time.
0 commit comments