Two multiplies are very nearly free on a GPU.
One thing to try and wrap your head around is a shader is code that runs separately for every pixel the mesh is visible on screen. That compare isn’t comparing “the texture”, it’s comparing the color of that texture at the point that was sampled for the current on screen pixel. The texture could be a single pixel, but it’s still going to get sampled by every on screen pixel separately. That’s slightly cheaper than if there was a real full size texture there, but probably not as much cheaper as you think. Humorously, sampling a 1 pixel texture is the most costly thing in the graph. Everything afterwards is very nearly free in comparison.
However, doing a branch based on data that is sampled from a texture is the slowest kind of branch possible, as it both has to wait for the texture to be sampled, and then as to do a real branch between code paths which has a cost of its own. Also, because GPUs are SIMD processors that work on multiple pixels in parallel, if two pixels choose separate branches, you end up paying the cost of doing both paths in series, and then the extra cost of the branch itself.
However, a real branch costs more than those two multiplies, and shader compilers are smart enough to know that, so the shader compiler will never actually use a real branch for this. Instead for simple cases like above it’s more likely to use a “fast branch”, aka a swap. It’ll just run the code on both paths and choose the wanted results afterwards. This means you’re paying the cost of “both paths”, but since one path doesn’t actually do anything it’s fine, and a swap is faster than a real branch.
Except a swap also costs more than two multiplies, and shader compilers are smart enough to know that, and that the above “branch” doesn’t actually do anything useful. So, the funny thing is it’s very unlikely that it’ll even include a swap. It’ll just always run the two multiplies and ignore the branch and comparison entirely, striping that from the compiled shader.
TLDR: The branch is not only not needed, it doesn’t actually do anything at all in this specific case and will be entirely ignored.
You still shouldn’t add the nodes though, as even though it doesn’t do anything in the final shader, it does mean it’s more for the shader generator and compiler to do. There’s also no guarantee the shader compiler will make these smart decisions. It may leave a real branch in there sometimes.