refactor(router):remove unused parameter pathIndex (#13180)

This commit is contained in:
liufc 2016-12-02 05:25:53 +08:00 committed by Alex Rickabaugh
parent 25a6da244c
commit 12959f444c
1 changed files with 6 additions and 6 deletions

View File

@ -67,7 +67,7 @@ class Recognizer {
if (segmentGroup.segments.length === 0 && segmentGroup.hasChildren()) {
return this.processChildren(config, segmentGroup);
} 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(
config: Route[], segmentGroup: UrlSegmentGroup, pathIndex: number, segments: UrlSegment[],
config: Route[], segmentGroup: UrlSegmentGroup, segments: UrlSegment[],
outlet: string): TreeNode<ActivatedRouteSnapshot>[] {
for (const r of config) {
try {
return this.processSegmentAgainstRoute(r, segmentGroup, pathIndex, segments, outlet);
return this.processSegmentAgainstRoute(r, segmentGroup, segments, outlet);
} catch (e) {
if (!(e instanceof NoMatch)) throw e;
}
@ -103,7 +103,7 @@ class Recognizer {
}
processSegmentAgainstRoute(
route: Route, rawSegment: UrlSegmentGroup, pathIndex: number, segments: UrlSegment[],
route: Route, rawSegment: UrlSegmentGroup, segments: UrlSegment[],
outlet: string): TreeNode<ActivatedRouteSnapshot>[] {
if (route.redirectTo) throw new NoMatch();
@ -140,8 +140,8 @@ class Recognizer {
return [new TreeNode<ActivatedRouteSnapshot>(snapshot, [])];
} else {
const children = this.processSegment(
childConfig, segmentGroup, pathIndex + lastChild, slicedSegments, PRIMARY_OUTLET);
const children =
this.processSegment(childConfig, segmentGroup, slicedSegments, PRIMARY_OUTLET);
return [new TreeNode<ActivatedRouteSnapshot>(snapshot, children)];
}
}