summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_extension.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_extension.cpp')
-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 0b55fc91dd..315e33fd7e 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -219,17 +219,13 @@ int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count) {
}
uint32_t FX_HashCode_GetA(const CFX_ByteStringC& str, bool bIgnoreCase) {
- const FX_CHAR* pStr = str.c_str();
- const FX_CHAR* pStrEnd = pStr + str.GetLength();
uint32_t dwHashCode = 0;
if (bIgnoreCase) {
- while (pStr < pStrEnd) {
- dwHashCode = 31 * dwHashCode + FXSYS_tolower(*pStr++);
- }
+ for (FX_STRSIZE i = 0; i < str.GetLength(); ++i)
+ dwHashCode = 31 * dwHashCode + FXSYS_tolower(str.CharAt(i));
} else {
- while (pStr < pStrEnd) {
- dwHashCode = 31 * dwHashCode + *pStr++;
- }
+ for (FX_STRSIZE i = 0; i < str.GetLength(); ++i)
+ dwHashCode = 31 * dwHashCode + str.CharAt(i);
}
return dwHashCode;
}