Couldn't this be hoisted up to the earlier filter splitting/parsing loop to save needless recomputation during the actual filtering?