forked from MapComplete/MapComplete
WIP: test workaround
This commit is contained in:
parent
4294e49305
commit
48a0a5b520
1 changed files with 9 additions and 0 deletions
|
|
@ -314,6 +314,14 @@ export class And<T extends TagsFilter = TagsFilter> extends TagsFilter {
|
||||||
for (let j = i + 1; j < optimized.length; j++) {
|
for (let j = i + 1; j < optimized.length; j++) {
|
||||||
const ti = optimized[i]
|
const ti = optimized[i]
|
||||||
const tj = optimized[j]
|
const tj = optimized[j]
|
||||||
|
if (
|
||||||
|
!ti ||
|
||||||
|
!tj ||
|
||||||
|
typeof ti.shadows !== "function" ||
|
||||||
|
typeof tj.shadows !== "function"
|
||||||
|
) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if (ti.shadows(tj)) {
|
if (ti.shadows(tj)) {
|
||||||
// if 'ti' is true, this implies 'tj' is always true as well.
|
// if 'ti' is true, this implies 'tj' is always true as well.
|
||||||
// if 'ti' is false, then 'tj' might be true or false
|
// if 'ti' is false, then 'tj' might be true or false
|
||||||
|
|
@ -322,6 +330,7 @@ export class And<T extends TagsFilter = TagsFilter> extends TagsFilter {
|
||||||
// If 'ti' is true, then 'tj' will be true too and 'tj' can be ignored
|
// If 'ti' is true, then 'tj' will be true too and 'tj' can be ignored
|
||||||
// If 'ti' is false, then the entire expression will be false and it doesn't matter what 'tj' yields
|
// If 'ti' is false, then the entire expression will be false and it doesn't matter what 'tj' yields
|
||||||
optimized.splice(j, 1)
|
optimized.splice(j, 1)
|
||||||
|
j--
|
||||||
} else if (tj.shadows(ti)) {
|
} else if (tj.shadows(ti)) {
|
||||||
optimized.splice(i, 1)
|
optimized.splice(i, 1)
|
||||||
i--
|
i--
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue