Place the calculation of mask prior to the calls of comp in replace_list to improve performance
- [X] closes #33920
- [X] tests added / passed
- [X] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry
