fix: normalize MITC4 reference identities

This commit is contained in:
KOKO\Mimi
2026-08-12 22:29:12 +09:00
parent b805683832
commit 56833abe68
3 changed files with 25 additions and 4 deletions
+15 -3
View File
@@ -120,13 +120,25 @@ double parseFiniteDouble(const std::string& field) {
return value;
}
std::string uppercaseAscii(std::string value) {
std::transform(
value.begin(), value.end(), value.begin(), [](const char character) {
return character >= 'a' && character <= 'z'
? static_cast<char>(character - 'a' + 'A')
: character;
});
return value;
}
struct IdentityKey {
std::string instanceName;
std::int64_t sourceNodeLabel;
bool operator<(const IdentityKey& other) const noexcept {
if (instanceName != other.instanceName) {
return instanceName < other.instanceName;
bool operator<(const IdentityKey& other) const {
const std::string normalizedInstance = uppercaseAscii(instanceName);
const std::string normalizedOther = uppercaseAscii(other.instanceName);
if (normalizedInstance != normalizedOther) {
return normalizedInstance < normalizedOther;
}
return sourceNodeLabel < other.sourceNodeLabel;
}