Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
In Line IF - Speed question or compiler issue
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
In Line IF - Speed question or compiler issue
Divers
Thread ID:
00922714
Message ID:
00922714
Vues:
74
I have seen some code that uses the In-line IF (My words not the help file)
expression ? trueCondition : falseCondition
What is faster in code execution in line or straight IF structure?

i.e.

Is this faster than :
if (TestExpression)
{
   DoSomething1 = true;
   Dosomething2 = true;
   DoSomething3 = false;
}
else
{
   DoSomething1 = false;
   Dosomething2 = false;
   DoSomething3 = true;

}
this..
DoSomething1 = TestExpression ? true : false;
Dosomething2 = TestExpression ? true : false;
DoSomething3 = TestExpression ? false : true;
Thanks!
Shawn Dorion
Geo Sektor Dot Com
Website: http://www.geosektor.com

Web Hosting Plans
Visit : http://WebHosting.Applications4u.com/
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform