Closed kphoenix137 closed 2 months ago
I'm not sure that unordered_map
is really going to perform better than the switch-case with just three options.
I'm not sure that
unordered_map
is really going to perform better than the switch-case with just three options.
I'm sure the difference is negligible in this case. Which one is more user friendly for modification?
Which one is more user friendly for modification?
Neither. The code is all here in this one tiny method, and modification can be mostly a copy/paste job either way.
Which one is more user friendly for modification?
Neither. The code is all here in this one tiny method, and modification can be mostly a copy/paste job either way.
Sounds good, I will close.
Improves performance and maintainability by using a lookup table instead of switch-case conditions.