Raised This Month: $ Target: $400
 0% 

[SOLVED] How I can optimize this code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-13-2014 , 20:07   Re: [HELP] How I can optimize this code?
Reply With Quote #2

Use a switch instead of a bunch of if else if statements.

Alternatively, if each case is identical other than the model (string), you would be able to make it into a single statement where you index the arrays of strings appropriately. However, this wouldn't necessarily make it more efficient than the switch but it would make it much easier to read and more expandable.
__________________

Last edited by fysiks; 10-13-2014 at 20:10.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode