diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index 0791305e..1f2223d1 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -819,12 +819,9 @@ std::vector numericSort(std::vector input, bool { // Pre-condition: all strings in "input" are convertible to int with stoiStrict. std::vector inputAsInts; - std::map intToString; // Cache for ints converted to strings. for (auto it = input.begin(); it != input.end(); ++it) { - int converted = stoiStrict(*it); - inputAsInts.push_back(converted); - intToString[converted] = *it; + inputAsInts.push_back(stoiStrict(*it)); } std::sort(inputAsInts.begin(), inputAsInts.end(), [isDescending](int a, int b) { @@ -840,7 +837,7 @@ std::vector numericSort(std::vector input, bool std::vector output; for (auto it = inputAsInts.begin(); it != inputAsInts.end(); ++it) { - output.push_back(intToString[*it]); + output.push_back(std::to_wstring(*it)); } return output; } \ No newline at end of file