refactor(router):remove unused parameter pathIndex (#13180)
This commit is contained in:
parent
25a6da244c
commit
12959f444c
|
@ -67,7 +67,7 @@ class Recognizer {
|
||||||
if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
|
if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
|
||||||
return this.processChildren(config, segmentGroup);
|
return this.processChildren(config, segmentGroup);
|
||||||
} else {
|
} else {
|
||||||
return this.processSegment(config, segmentGroup, 0, segmentGroup.segments, outlet);
|
return this.processSegment(config, segmentGroup, segmentGroup.segments, outlet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,11 +81,11 @@ class Recognizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
processSegment(
|
processSegment(
|
||||||
config: Route[], segmentGroup: UrlSegmentGroup, pathIndex: number, segments: UrlSegment[],
|
config: Route[], segmentGroup: UrlSegmentGroup, segments: UrlSegment[],
|
||||||
outlet: string): TreeNode<ActivatedRouteSnapshot>[] {
|
outlet: string): TreeNode<ActivatedRouteSnapshot>[] {
|
||||||
for (const r of config) {
|
for (const r of config) {
|
||||||
try {
|
try {
|
||||||
return this.processSegmentAgainstRoute(r, segmentGroup, pathIndex, segments, outlet);
|
return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!(e instanceof NoMatch)) throw e;
|
if (!(e instanceof NoMatch)) throw e;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ class Recognizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
processSegmentAgainstRoute(
|
processSegmentAgainstRoute(
|
||||||
route: Route, rawSegment: UrlSegmentGroup, pathIndex: number, segments: UrlSegment[],
|
route: Route, rawSegment: UrlSegmentGroup, segments: UrlSegment[],
|
||||||
outlet: string): TreeNode<ActivatedRouteSnapshot>[] {
|
outlet: string): TreeNode<ActivatedRouteSnapshot>[] {
|
||||||
if (route.redirectTo) throw new NoMatch();
|
if (route.redirectTo) throw new NoMatch();
|
||||||
|
|
||||||
|
@ -140,8 +140,8 @@ class Recognizer {
|
||||||
return [new TreeNode<ActivatedRouteSnapshot>(snapshot, [])];
|
return [new TreeNode<ActivatedRouteSnapshot>(snapshot, [])];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const children = this.processSegment(
|
const children =
|
||||||
childConfig, segmentGroup, pathIndex + lastChild, slicedSegments, PRIMARY_OUTLET);
|
this.processSegment(childConfig, segmentGroup, slicedSegments, PRIMARY_OUTLET);
|
||||||
return [new TreeNode<ActivatedRouteSnapshot>(snapshot, children)];
|
return [new TreeNode<ActivatedRouteSnapshot>(snapshot, children)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue