remove unnecessary comparison with second match