From 28c7844c1ef5ea0c8727b890e9ff56b593119a00 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 12 May 2016 15:52:14 -0700 Subject: Add CFX_ByteStringC::CharAt() to avoid c_str() and casts. Most of the time, we want to operate on chars as if they were unsigned, but there are a few places where we need the default (questionably signed) values. Consolidate the casting in a single place rather than forcing callers to get a char* ptr. BUG=pdfium:493 Review-Url: https://codereview.chromium.org/1972053003 --- core/fxcrt/fx_basic_bstring.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/fxcrt/fx_basic_bstring.cpp') diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp index 18e240bc84..e035dd53d1 100644 --- a/core/fxcrt/fx_basic_bstring.cpp +++ b/core/fxcrt/fx_basic_bstring.cpp @@ -99,9 +99,8 @@ CFX_ByteString::CFX_ByteString(char ch) { } CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& stringSrc) { - if (!stringSrc.IsEmpty()) { + if (!stringSrc.IsEmpty()) m_pData.Reset(StringData::Create(stringSrc.c_str(), stringSrc.GetLength())); - } } CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& str1, -- cgit v1.2.3