summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-05-18 06:17:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-18 06:17:21 -0700
commit5c9b65e603ee970b1a5cfbdf09273885a31e877b (patch)
tree037f00e75ad13b2f82b014f037591842a563a862
parentbe9b8947d0090e20116822fe7caf5e7973d6b20a (diff)
downloadpdfium-5c9b65e603ee970b1a5cfbdf09273885a31e877b.tar.xz
Remove c_str() from widestring checksum variant.
Brings it back in line with bytestring version. Review-Url: https://codereview.chromium.org/1985223002
-rw-r--r--core/fxcrt/fx_extension.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index 315e33fd7e..1dddf09fd6 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -231,17 +231,13 @@ uint32_t FX_HashCode_GetA(const CFX_ByteStringC& str, bool bIgnoreCase) {
}
uint32_t FX_HashCode_GetW(const CFX_WideStringC& str, bool bIgnoreCase) {
- const FX_WCHAR* pStr = str.c_str();
- const FX_WCHAR* pStrEnd = pStr + str.GetLength();
uint32_t dwHashCode = 0;
if (bIgnoreCase) {
- while (pStr < pStrEnd) {
- dwHashCode = 1313 * dwHashCode + FXSYS_tolower(*pStr++);
- }
+ for (FX_STRSIZE i = 0; i < str.GetLength(); ++i)
+ dwHashCode = 1313 * dwHashCode + FXSYS_tolower(str.CharAt(i));
} else {
- while (pStr < pStrEnd) {
- dwHashCode = 1313 * dwHashCode + *pStr++;
- }
+ for (FX_STRSIZE i = 0; i < str.GetLength(); ++i)
+ dwHashCode = 1313 * dwHashCode + str.CharAt(i);
}
return dwHashCode;
}