We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5c5dbf5 + 76bd06a commit 5c10a83Copy full SHA for 5c10a83
include/cppcore/Common/TStringBase.h
@@ -158,7 +158,7 @@ inline void TStringBase<T>::clear() {
158
mStringBuffer = nullptr;
159
mCapacity = InitSize;
160
}
161
- mSize = 0;
+ reset();
162
163
164
template <class T>
@@ -184,8 +184,12 @@ inline bool TStringBase<T>::operator == (const TStringBase<T> &rhs) const {
184
return false;
185
186
187
+ if (mHashId != rhs.mHashId) {
188
+ return false;
189
+ }
190
- return mHashId == rhs.mHashId;
191
+ // Fallback to actual comparison in case of hash collision
192
+ return memcmp(c_str(), rhs.c_str(), mSize * sizeof(T)) == 0;
193
194
195
0 commit comments