mardi 8 septembre 2015

would the c# compiler read useless "if" structures?

First of all I do apologize cause my English is not well. i want to know if the C# compiler reads the useless if(){} structures or not. i mean when i have a "if" structure in my code that repeats 100000... times, but the condition of the "if" goes true only once, will the compiler read the functions that is in the "if" or the compiler only check the condition every time ? would it be effective on render time ?

for (long i = 0; i< 100000000000000; i++)
{
    if (i == 999)
    {
        "lots of functions"
    }
}

does the compiler ignore the rest of "if" when the condition is not true?

Aucun commentaire:

Enregistrer un commentaire