Skip to content

Commit 0e5b3ec

Browse files
author
Swagtoy
committed
Bring back string early return, remove header
1 parent db179d7 commit 0e5b3ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

irr/include/irrString.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <cstdio>
1212
#include <cstring>
1313
#include <cwchar>
14-
#include <type_traits>
1514

1615
/* HACK: import these string methods from MT's util/string.h */
1716
extern std::wstring utf8_to_wide(std::string_view input);
@@ -167,7 +166,7 @@ class string
167166

168167
//! Assignment operator for strings, ASCII and Unicode
169168
template <class B>
170-
string<T> &operator=(const B * c)
169+
string<T> &operator=(const B *const c)
171170
{
172171
if (!c) {
173172
clear();
@@ -179,6 +178,8 @@ class string
179178
(uintptr_t)c >= (uintptr_t)(str.data()) &&
180179
(uintptr_t)c < (uintptr_t)(str.data() + str.size()));
181180
}
181+
182+
if ((void *)c == (void *)c_str()) return *this;
182183

183184
u32 len = calclen(c);
184185
// In case `c` is a pointer to our own buffer, we may not resize first

0 commit comments

Comments
 (0)