diff options
Diffstat (limited to 'core/fxcrt/cfx_bytestring.cpp')
-rw-r--r-- | core/fxcrt/cfx_bytestring.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/fxcrt/cfx_bytestring.cpp b/core/fxcrt/cfx_bytestring.cpp index 0aba3be12a..cd049dcc5d 100644 --- a/core/fxcrt/cfx_bytestring.cpp +++ b/core/fxcrt/cfx_bytestring.cpp @@ -518,6 +518,12 @@ void CFX_ByteString::Format(const char* pFormat, ...) { va_end(argList); } +void CFX_ByteString::SetAt(FX_STRSIZE index, char c) { + ASSERT(index >= 0 && index < GetLength()); + ReallocBeforeWrite(m_pData->m_nDataLength); + m_pData->m_String[index] = c; +} + FX_STRSIZE CFX_ByteString::Insert(FX_STRSIZE index, char ch) { const FX_STRSIZE cur_length = m_pData ? m_pData->m_nDataLength : 0; if (index != pdfium::clamp(index, 0, cur_length)) @@ -694,12 +700,6 @@ FX_STRSIZE CFX_ByteString::Replace(const CFX_ByteStringC& pOld, return nCount; } -void CFX_ByteString::SetAt(FX_STRSIZE index, char c) { - ASSERT(index >= 0 && index < GetLength()); - ReallocBeforeWrite(m_pData->m_nDataLength); - m_pData->m_String[index] = c; -} - CFX_WideString CFX_ByteString::UTF8Decode() const { CFX_UTF8Decoder decoder; for (FX_STRSIZE i = 0; i < GetLength(); i++) { @@ -721,10 +721,10 @@ int CFX_ByteString::Compare(const CFX_ByteStringC& str) const { int that_len = str.GetLength(); int min_len = this_len < that_len ? this_len : that_len; for (int i = 0; i < min_len; i++) { - if ((uint8_t)m_pData->m_String[i] < str.GetAt(i)) { + if ((uint8_t)m_pData->m_String[i] < str[i]) { return -1; } - if ((uint8_t)m_pData->m_String[i] > str.GetAt(i)) { + if ((uint8_t)m_pData->m_String[i] > str[i]) { return 1; } } |