summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_basic_bstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fxcrt/fx_basic_bstring.cpp')
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index 5eeb33b049..9f54414110 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -132,9 +132,10 @@ CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& stringSrc)
if (stringSrc.IsEmpty()) {
m_pData = NULL;
return;
+ } else {
+ m_pData = NULL;
+ *this = stringSrc;
}
- m_pData = NULL;
- *this = stringSrc;
}
CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& str1, const CFX_ByteStringC& str2)
{
@@ -970,15 +971,13 @@ int CFX_ByteString::Compare(const CFX_ByteStringC& str) const
for (int i = 0; i < min_len; i ++) {
if ((uint8_t)m_pData->m_String[i] < str.GetAt(i)) {
return -1;
- }
- if ((uint8_t)m_pData->m_String[i] > str.GetAt(i)) {
+ } else if ((uint8_t)m_pData->m_String[i] > str.GetAt(i)) {
return 1;
}
}
if (this_len < that_len) {
return -1;
- }
- if (this_len > that_len) {
+ } else if (this_len > that_len) {
return 1;
}
return 0;