How deleting one if-statement made this filter 4x faster