It would be fractionally faster to use a local variable, and only assign to currentMatch in the if()