On Fri, 2016-04-22 at 17:34 +0100, Mark Thomas wrote: > On 22/04/2016 17:24, Leon Rosenberg wrote: > > Lets say I have three possible conditions, A, B and C, which are exclusive. > > My native approach would be: > > if (A){...} > > if (B){...} > > if (C){...} > > > > now some people would 'optimize' it as > > if (A){ ...} else if (B) {....} else if (C) { ....} > > and I think in the world of single-cpu computers this optimization could > > work. > > <snip> > As an aside, why can't the compile optimize to test the three conditions > in parallel with the "else if"?
Actually, I would think the compiler could do a parallel optimization for "if else" but more likely could NOT for a series of "if"s as often only the programmer knows whether the "if" series is mutually exclusive. > > Mark > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org