gzdwsu / RaiderSMA

Murphy's Wrestling Tournament Manager. Design of Info Tech Sys. Secondary Project.
1 stars 17 forks source link

(Claimed) Match.java Optimization #27

Closed JamesKillmonger closed 4 years ago

JamesKillmonger commented 4 years ago

Location: src/DataClasses/Match.java

Lines: 181-202 as of 3/9/2020

Deficiency: I suggest instead of using a bunch of if, else and else if statements we can use Switch Statements.

Reason: Not only does it help the code be much more readable thus making manually following along less a headache for our programmers, but even better it increases performance. "When using a switch statement the compiler knows the constants are the same type and all that needs to be done is comparing the equality of each switch." Using if else statements the compiler does not know such things, thus unnecessary extra work is being done. Switch cases can be implemented into this method however it will need to be assisted through some code to make it possible for me to use switch statements in here which I shall do.

Information Sources: https://www.geeksforgeeks.org/switch-vs-else/

JamesKillmonger commented 4 years ago

I James Walter Wright claim this issue for Project 2, any other claims are forbidden.