From 6eeffab789800e2afa1b9d10de70c9116db32355 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 13 Oct 2015 12:02:11 -0700 Subject: wstring allocations waste up to 7 wasted bytes. Consequence of having the same code in two places; fx_basic_bstring.cpp is correct, but fx_basic_wstring.cpp is missing one small change. Noticed while working on 542403, but this will not fix that issue. It is just a space savings. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1399983003 . --- core/src/fxcrt/fx_basic_wstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/src') diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp index e7f8c01d41..c097e1fc09 100644 --- a/core/src/fxcrt/fx_basic_wstring.cpp +++ b/core/src/fxcrt/fx_basic_wstring.cpp @@ -32,7 +32,7 @@ CFX_WideString::StringData* CFX_WideString::StringData::Create(int nLen) { int usableLen = (totalSize - overhead) / sizeof(FX_WCHAR); FXSYS_assert(usableLen >= nLen); - void* pData = FX_Alloc(uint8_t, iSize.ValueOrDie()); + void* pData = FX_Alloc(uint8_t, totalSize); return new (pData) StringData(nLen, usableLen); } CFX_WideString::~CFX_WideString() { -- cgit v1.2.3