Optimize allowList matching

If `allowList` is empty, theres no need to check `matchFound` because it's always true.
Also, if a match was found, theres no need to check the remaining entries.