The std::transform is happening twice for each comparison done during the sort; this looks bad cpu-wise;
One option to fix this is using a sorted map with the lowercased items as keys. Other option is moving the lowercasing to a method of Application, where we can cache it if needed.
Also, please move the sorting into its own function, and create unit tests for it.
The std::transform is happening twice for each comparison done during the sort; this looks bad cpu-wise;
One option to fix this is using a sorted map with the lowercased items as keys. Other option is moving the lowercasing to a method of Application, where we can cache it if needed.
Also, please move the sorting into its own function, and create unit tests for it.