FIX: the sorting of AMS list

JIRA: [STUDIO-14738] [STUDIO-14651]
Change-Id: I6d4b89edc77383be8afacf9823567bc756c8e2ed
(cherry picked from commit 8defa1f50b4b556c6ebaf2ad533ba09ad3f23e38)
This commit is contained in:
xin.zhang
2025-09-24 14:06:36 +08:00
committed by Noisyfox
parent 2234b227c4
commit 8d3da67254
4 changed files with 27 additions and 7 deletions

View File

@@ -85,4 +85,23 @@ public:
static std::string get_longlong_val(const nlohmann::json& j);
};
struct NumericStrCompare
{
bool operator()(const std::string& a, const std::string& b) const noexcept
{
int ai = -1;
try {
ai = std::stoi(a);
} catch (...) { };
int bi = -1;
try {
bi = std::stoi(b);
} catch (...) { };
return ai < bi;
}
};
}; // namespace Slic3r