Skip to content

Commit 56e0011

Browse files
committed
feat(optimized matcher): minors.
1 parent 4cd937f commit 56e0011

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/create-matcher.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function createMatcher (
8686
return _createRoute(record, location, redirectedFrom)
8787
} else if (location.path) {
8888
location.params = {}
89-
const record = _optimizedMatcher(location)
89+
const record = _optimizedMatcher(location.path, location.params)
9090
if (record) {
9191
return _createRoute(record, location, redirectedFrom)
9292
}
@@ -254,8 +254,8 @@ function optimizedMatcher (
254254
}
255255
})
256256

257-
function match (location) {
258-
const cleanPath = location.path.replace(/\/$/, '')
257+
function match (path, params) {
258+
const cleanPath = path.replace(/\/$/, '')
259259
let staticRecord = staticMap[cleanPath]
260260

261261
if (!staticRecord) {
@@ -270,7 +270,7 @@ function optimizedMatcher (
270270
if (staticRecord && index >= staticRecord.index) {
271271
break
272272
}
273-
if (matchRoute(route.regex, location.path, location.params)) {
273+
if (matchRoute(route.regex, path, params)) {
274274
return route
275275
}
276276
}

0 commit comments

Comments
 (0)