Click here to Skip to main content
14,836,072 members
Home / Discussions / C#
   

C#

 
GeneralRe: 'switch' statement efficiency in C# Pin
leppie30-Jul-08 22:52
Memberleppie30-Jul-08 22:52 
GeneralRe: 'switch' statement efficiency in C# Pin
Christian Graus30-Jul-08 23:57
protectorChristian Graus30-Jul-08 23:57 
GeneralRe: 'switch' statement efficiency in C# Pin
leppie31-Jul-08 0:14
Memberleppie31-Jul-08 0:14 
GeneralRe: 'switch' statement efficiency in C# Pin
Guffa31-Jul-08 1:57
MemberGuffa31-Jul-08 1:57 
GeneralRe: 'switch' statement efficiency in C# Pin
leppie31-Jul-08 2:17
Memberleppie31-Jul-08 2:17 
GeneralRe: 'switch' statement efficiency in C# Pin
Guffa31-Jul-08 2:58
MemberGuffa31-Jul-08 2:58 
GeneralRe: 'switch' statement efficiency in C# Pin
leppie31-Jul-08 5:46
Memberleppie31-Jul-08 5:46 
GeneralRe: 'switch' statement efficiency in C# Pin
leppie30-Jul-08 22:51
Memberleppie30-Jul-08 22:51 
Christian Graus wrote:
scody wrote:
but in C#, order of the 'cases' doesn’t matter.

What on earth makes you think that ?


What on earth makes you think it does matter?

Christian Graus wrote:
the MSIL for a switch is no different to a bunch of if/then/else statements


The MSIL for a switch is jumptable, not if/else branching. For integral types, the target offset is simply computed (not sure what happens internally), in your typical state machine fashion. For strings the behaviour could be different.

xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)

GeneralRe: 'switch' statement efficiency in C# Pin
Guffa31-Jul-08 1:18
MemberGuffa31-Jul-08 1:18 
AnswerRe: 'switch' statement efficiency in C# Pin
PIEBALDconsult3-Aug-08 17:07
professionalPIEBALDconsult3-Aug-08 17:07 
QuestionConvert a Java timestamp to C# DateTime object Pin
cyrus_virus30-Jul-08 19:26
Membercyrus_virus30-Jul-08 19:26 
AnswerRe: Convert a Java timestamp to C# DateTime object Pin
Christian Graus30-Jul-08 20:03
protectorChristian Graus30-Jul-08 20:03 
AnswerRe: Convert a Java timestamp to C# DateTime object Pin
Mike Dimmick31-Jul-08 1:16
MemberMike Dimmick31-Jul-08 1:16 
AnswerRe: Convert a Java timestamp to C# DateTime object Pin
curtisk31-Jul-08 3:49
Membercurtisk31-Jul-08 3:49 
Questiongetting excel cell reference Pin
Mogaambo30-Jul-08 19:19
MemberMogaambo30-Jul-08 19:19 
Questionproblem to solve the warning!! Pin
ktamanna30-Jul-08 18:33
Memberktamanna30-Jul-08 18:33 
AnswerRe: problem to solve the warning!! Pin
Christian Graus30-Jul-08 19:39
protectorChristian Graus30-Jul-08 19:39 
AnswerRe: problem to solve the warning!! Pin
Vimalsoft(Pty) Ltd30-Jul-08 19:44
professionalVimalsoft(Pty) Ltd30-Jul-08 19:44 
Questionwhat type of value does switch statement allow to use?such as switch(?){....} Pin
panyl30-Jul-08 16:18
Memberpanyl30-Jul-08 16:18 
AnswerRe: what type of value does switch statement allow to use?such as switch(?){....} Pin
Christian Graus30-Jul-08 16:55
protectorChristian Graus30-Jul-08 16:55 
AnswerRe: what type of value does switch statement allow to use?such as switch(?){....} [modified] Pin
DaveyM6930-Jul-08 23:37
professionalDaveyM6930-Jul-08 23:37 
AnswerRe: what type of value does switch statement allow to use?such as switch(?){....} Pin
PIEBALDconsult3-Aug-08 17:01
professionalPIEBALDconsult3-Aug-08 17:01 
QuestionHow to File Upload to Code project Pin
bruze30-Jul-08 11:31
Memberbruze30-Jul-08 11:31 
AnswerRe: How to File Upload to Code project Pin
Judah Gabriel Himango30-Jul-08 12:46
sponsorJudah Gabriel Himango30-Jul-08 12:46 
AnswerRe: How to File Upload to Code project Pin
jedliu204630-Jul-08 15:55
Memberjedliu204630-Jul-08 15:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.