<?xml version="1.0" encoding="windows-1252"?>
<node id="301421" title="Re: Re: Re: Perl Idioms Explained: &amp;&amp; and || &quot;Short Circuit&quot; operators" created="2003-10-22 19:17:12" updated="2005-07-07 15:24:52">
<type id="11">
note</type>
<author id="214545">
fletcher_the_dog</author>
<data>
<field name="doctext">
C switch statements create an internal jump table that is more or less like a hash so that they can skip testing cases that are are going to fail, this makes them O(1). For example in the following switch statement if 'test' equals 'c' the code jumps right to case 'c', it doesn't test to see if 'test' equals 'a' or 'b':
&lt;CODE&gt;
switch(test){
  case 'a':
   # do something
  case 'b':
   # do something else
  case 'c':
   # do something else
}
&lt;/CODE&gt;
This of course means that the possible cases (but not the test value) are static and must be known at compile time which decreases flexibilty but increases speed.</field>
<field name="root_node">
301355</field>
<field name="parent_node">
301410</field>
</data>
</node>
