UBool LSR::isEquivalentTo(const LSR &other) const { return
uprv_strcmp(language, other.language) == 0 &&
uprv_strcmp(script, other.script) == 0 &&
regionIndex == other.regionIndex && // Compare regions if both are ill-formed (and their indexes are 0).
(regionIndex > 0 || uprv_strcmp(region, other.region) == 0);
}
bool LSR::operator==(const LSR &other) const { return
uprv_strcmp(language, other.language) == 0 &&
uprv_strcmp(script, other.script) == 0 &&
regionIndex == other.regionIndex && // Compare regions if both are ill-formed (and their indexes are 0).
(regionIndex > 0 || uprv_strcmp(region, other.region) == 0) &&
flags == other.flags;
}
int32_t LSR::indexForRegion(constchar *region) {
int32_t c = region[0];
int32_t a = c - '0'; if (0 <= a && a <= 9) { // digits: "419"
int32_t b = region[1] - '0'; if (b < 0 || 9 < b) { return0; }
c = region[2] - '0'; if (c < 0 || 9 < c || region[3] != 0) { return0; } return (10 * a + b) * 10 + c + 1;
} else { // letters: "DE"
a = uprv_upperOrdinal(c); if (a < 0 || 25 < a) { return0; }
int32_t b = uprv_upperOrdinal(region[1]); if (b < 0 || 25 < b || region[2] != 0) { return0; } return26 * a + b + 1001;
} return0;
}
LSR &LSR::setHashCode() { if (hashCode == 0) {
uint32_t h = ustr_hashCharsN(language, static_cast<int32_t>(uprv_strlen(language)));
h = h * 37 + ustr_hashCharsN(script, static_cast<int32_t>(uprv_strlen(script)));
h = h * 37 + regionIndex;
hashCode = h * 37 + flags;
} return *this;
}
U_NAMESPACE_END
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.