зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1780155 - Remove unnecessary + 1 in StringBuffer ExtractWellSized. r=sfink
This probably goes back to null-terminated strings. Differential Revision: https://phabricator.services.mozilla.com/D152146
This commit is contained in:
Родитель
4ba91ba30e
Коммит
f10bc46101
|
@ -34,7 +34,7 @@ static CharT* ExtractWellSized(Buffer& cb) {
|
|||
/* For medium/big buffers, avoid wasting more than 1/4 of the memory. */
|
||||
MOZ_ASSERT(capacity >= length);
|
||||
if (length > Buffer::sMaxInlineStorage && capacity - length > length / 4) {
|
||||
CharT* tmp = allocPolicy.pod_realloc<CharT>(buf, capacity, length + 1);
|
||||
CharT* tmp = allocPolicy.pod_realloc<CharT>(buf, capacity, length);
|
||||
if (!tmp) {
|
||||
allocPolicy.free_(buf);
|
||||
return nullptr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче