05/03/29 22:12:38
>>204
違うだろ。
case値が連番のときはtableswitchで
ジャンプテーブル作ってくれるからelse ifで一個ずつ
比較するより速いはず。
連番でなくても
The Java virtual machine specifies that the table of the lookupswitch instruction must be sorted by key
so that implementations may use searches more efficient than a linear scan.
URLリンク(java.sun.com)
ここの7.10 Compiling Switchesでも読んどけ