Right, I forgot to tell you that by adding an array of Runnables you're adding a layer of indirection, which is the opposite of what you actually asked, even though it's leads to a whole lot more maintainable code.
What do you mean by "optimization"? Do you want to speed up the switch statement? I don't think you can. On Fri, Mar 27, 2009 at 12:38 AM, Michael MacDonald <googlec...@antlersoft.com> wrote: > > Switch statements generally compile to very efficient code. You might > change it to something table driven, with an array of options, and it > might be easier to maintain that way; but for speed of execution a > switch statement will work very well. > > HotHeart wrote: >> I have switch with 255 cases in my project - DroidGear... >> How i could optimize it? >> >> Sorry for my english >> > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---