Replace long ifs with switch/cases
While compilers may optimize those anyways, it's always better to give it an hint that to use an index table in case, other than than, it makes the code cleaner to read and easier to maintain.
While compilers may optimize those anyways, it's always better to give it an hint that to use an index table in case, other than than, it makes the code cleaner to read and easier to maintain.