Rename requal to matcherEquals
This commit is contained in:
parent
a8f4c74de9
commit
037abe45a5
12
route.js
12
route.js
|
@ -160,7 +160,7 @@ function Routing(exports) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function requal(a, b) {
|
function matcherEquals(a, b) {
|
||||||
if (a === null) {
|
if (a === null) {
|
||||||
return (b === null);
|
return (b === null);
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ function Routing(exports) {
|
||||||
|
|
||||||
for (var key in a.entries) {
|
for (var key in a.entries) {
|
||||||
if (!b.has(key)) return false;
|
if (!b.has(key)) return false;
|
||||||
if (!requal(a.entries[key], b.entries[key])) return false;
|
if (!matcherEquals(a.entries[key], b.entries[key])) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -509,9 +509,11 @@ function Routing(exports) {
|
||||||
// Here we ensure a "minimal" remainder in cases
|
// Here we ensure a "minimal" remainder in cases
|
||||||
// where after an erasure, a particular key's
|
// where after an erasure, a particular key's
|
||||||
// continuation is the same as the wildcard's
|
// continuation is the same as the wildcard's
|
||||||
// continuation. TODO: the requal check may be
|
// continuation. TODO: the matcherEquals check may
|
||||||
// expensive. If so, how can it be made cheaper?
|
// be expensive. If so, how can it be made
|
||||||
rupdateInplace(target, key, (requal(updatedK, w) ? emptyMatcher : updatedK));
|
// cheaper?
|
||||||
|
rupdateInplace(target, key,
|
||||||
|
(matcherEquals(updatedK, w) ? emptyMatcher : updatedK));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue