Optimize concatAndCompareAgainstFullHostRegex

This commit is contained in:
jorgectf
2021-09-07 19:05:03 +02:00
parent 800801177d
commit 4e261c61ae

View File

@@ -38,12 +38,8 @@ class LDAPPrivateHost extends StrConst {
}
predicate concatAndCompareAgainstFullHostRegex(LDAPSchema schema, StrConst host) {
schema instanceof LDAPSchema and
not host instanceof LDAPPrivateHost and
exists(string full_host |
full_host = schema.(StrConst).getText() + host.(StrConst).getText() and
full_host.regexpMatch(getFullHostRegex())
)
(schema.getText() + host.getText()).regexpMatch(getFullHostRegex())
}
// "ldap://" + "somethingon.theinternet.com"