> Thanks Jb. BTW, do you know if switch statements in IL are done in > linear or constant time? For example, if I have an a set of > instruction labels as jump targets in an array using the > OpCodes.Switch instruction and I already have the target index > computed at runtime, will it still have to do a comparison for each > case? And is there a limit on how many labels one can have in a switch > statement done in IL?
I did a quick test with a simple switch. Here what it looks like under a debugger (.Net 3.5 SP1, x86) jmp dword ptr [eax*4+0D50218h] So I believe it's a constant time :) --~--~---------~--~----~------------~-------~--~----~ -- mono-cecil -~----------~----~----~----~------~----~------~--~---
