From f7036ba5884b9829fcb17aea4f3a16831abb7516 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 13 May 2016 15:02:43 -0700 Subject: Templatize CFX_{Byte,Wide}StringC Review-Url: https://codereview.chromium.org/1874773002 --- core/fxcrt/fx_basic_bstring.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 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 e035dd53d1..3a81e41920 100644 --- a/core/fxcrt/fx_basic_bstring.cpp +++ b/core/fxcrt/fx_basic_bstring.cpp @@ -13,6 +13,7 @@ #include "third_party/base/numerics/safe_math.h" template class CFX_StringDataTemplate; +template class CFX_StringCTemplate; namespace { @@ -931,26 +932,6 @@ void CFX_ByteString::TrimLeft() { uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const { return AsStringC().GetID(start_pos); } -uint32_t CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const { - if (m_Length == 0) { - return 0; - } - if (start_pos < 0 || start_pos >= m_Length) { - return 0; - } - uint32_t strid = 0; - if (start_pos + 4 > m_Length) { - for (FX_STRSIZE i = 0; i < m_Length - start_pos; i++) { - strid = strid * 256 + m_Ptr[start_pos + i]; - } - strid = strid << ((4 - m_Length + start_pos) * 8); - } else { - for (int i = 0; i < 4; i++) { - strid = strid * 256 + m_Ptr[start_pos + i]; - } - } - return strid; -} FX_STRSIZE FX_ftoa(FX_FLOAT d, FX_CHAR* buf) { buf[0] = '0'; buf[1] = '\0'; -- cgit v1.2.3