Well, not checking first means fewer operations are carried out, so it’s technically less “costly” in this case to just set it right away.
In the grand scheme of things however, you’d probably have to do this thousands of times per frame to see any measurable difference.