News for hackers. Stuff that matters.
Re:The security hole in sudo by DHowett on Wednesday May 23, 2012 @12:14PM (#4013743)
It can be slightly less efficient when (on supporting architectures) the compiler could automatically generate a jump table in place of stacked conditionals, which it cannot do for a chain of ifs.
Re:The security hole in sudo by ajross on Wednesday May 23, 2012 @12:43PM (#4013870)
This is a myth that won't die. Jump tables can't be branch predicted, so they're generally significantly slower unless the number of cases is very high. And it's not true that the compiler "cannot" emit a jump table for an if chain anyway. A bunch of if/else-if expressions of the form "some_var == constant" can certainly be detected (though again, it probably isn't).