Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
In Line IF - Speed question or compiler issue
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
In Line IF - Speed question or compiler issue
Miscellaneous
Thread ID:
00922714
Message ID:
00922714
Views:
73
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/
Next
Reply
Map
View

Click here to load this message in the networking platform