mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 11:52:05 +00:00
FIX: the sorting of AMS list
JIRA: [STUDIO-14738] [STUDIO-14651] Change-Id: I6d4b89edc77383be8afacf9823567bc756c8e2ed (cherry picked from commit 8defa1f50b4b556c6ebaf2ad533ba09ad3f23e38)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user