зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1799250 - Don't use extractOrCopyRawBuffer in Locale.cpp; r=anba
Differential Revision: https://phabricator.services.mozilla.com/D161471
This commit is contained in:
Родитель
1d1700c1ef
Коммит
d6d0fb6210
|
@ -547,11 +547,8 @@ Result<Ok, Locale::CanonicalizationError> Locale::CanonicalizeUnicodeExtension(
|
|||
|
||||
// We can keep the previous extension when canonicalization didn't modify it.
|
||||
if (static_cast<Span<const char>>(sb) != extension) {
|
||||
// Null-terminate the new string and replace the previous extension.
|
||||
if (!sb.append('\0')) {
|
||||
return Err(CanonicalizationError::OutOfMemory);
|
||||
}
|
||||
UniqueChars canonical(sb.extractOrCopyRawBuffer());
|
||||
// Otherwise replace the previous extension with the canonical extension.
|
||||
UniqueChars canonical = DuplicateStringToUniqueChars(sb);
|
||||
if (!canonical) {
|
||||
return Err(CanonicalizationError::OutOfMemory);
|
||||
}
|
||||
|
@ -729,11 +726,8 @@ Locale::CanonicalizeTransformExtension(UniqueChars& aTransformExtension) {
|
|||
|
||||
// We can keep the previous extension when canonicalization didn't modify it.
|
||||
if (static_cast<Span<const char>>(sb) != extension) {
|
||||
// Null-terminate the new string and replace the previous extension.
|
||||
if (!sb.append('\0')) {
|
||||
return Err(CanonicalizationError::OutOfMemory);
|
||||
}
|
||||
UniqueChars canonical(sb.extractOrCopyRawBuffer());
|
||||
// Otherwise replace the previous extension with the canonical extension.
|
||||
UniqueChars canonical = DuplicateStringToUniqueChars(sb);
|
||||
if (!canonical) {
|
||||
return Err(CanonicalizationError::OutOfMemory);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче