it will compile to the same code because thanks to our fast processor they can do better optimizing which follows/tracks code paths.
it "sees" that both cases end with a return so it will generate example2 for both. I believe they even trash the commands after the if/then as they will never be used/reached.