Skip to content

Commit 7742b4e

Browse files
authored
TStringBase: Fix review findings
1 parent cee59bd commit 7742b4e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

include/cppcore/Common/TStringBase.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ class TStringBase {
4141
TStringBase() noexcept = default;
4242

4343
/// @brief The class constructor with a pointer showing to the data buffer.
44-
/// @param pPtr [in] The data buffer.
45-
TStringBase(const T *pPtr, size_t size);
44+
/// @param[in] ptr The data buffer.
45+
/// @param[in] size The buffer size.
46+
TStringBase(const T *ptr, size_t size);
4647

4748
/// @brief The class destructor.
4849
~TStringBase();
@@ -95,9 +96,9 @@ class TStringBase {
9596
};
9697

9798
template <class T>
98-
inline TStringBase<T>::TStringBase(const T *pPtr, size_t size) {
99-
copyFrom(*this, pPtr, size);
100-
mHashId = THash<HashId>::toHash(pPtr, mSize);
99+
inline TStringBase<T>::TStringBase(const T *ptr, size_t size) {
100+
copyFrom(*this, ptr, size);
101+
mHashId = THash<HashId>::toHash(c_str(), size());
101102
}
102103

103104
template <class T>
@@ -126,7 +127,7 @@ inline size_t TStringBase<T>::size() const {
126127

127128
template <class T>
128129
inline bool TStringBase<T>::isEmpty() const {
129-
return mSize == 0;
130+
return (mSize == 0);
130131
}
131132

132133
template <class T>

0 commit comments

Comments
 (0)