I would go with the second one. There will be very little performance impact but it is more readable.
The way I understand your code is that you want check if the culture is already in English or not and return the standard string if it is instead of translating it. In order for this to make a performance impact you have to take a few aspects in account
- How often do you expect the culture to be in English?
- How intensive is the translating operation?
- Can you pass around a non-english string as input?
Each of these remarks will have influence over your eventual design. You seem to be entertaining the thought of removing the english if
altogether and replace it with a ternary statement, aka: removing an if
and adding an if
in the wrong place.
And having considered all that: if your validation whether or not it's an english culture is the first statement inside your method, there will never be a notable difference between that and putting it outside in the ternary statement.
Let's not forget one of the ten comandments:
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.