Skip to content

Commit

Permalink
Bring back string early return, remove header
Browse files Browse the repository at this point in the history
  • Loading branch information
Swagtoy committed Oct 4, 2024
1 parent db179d7 commit 0e5b3ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions irr/include/irrString.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <cstdio>
#include <cstring>
#include <cwchar>
#include <type_traits>

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

//! Assignment operator for strings, ASCII and Unicode
template <class B>
string<T> &operator=(const B * c)
string<T> &operator=(const B *const c)
{
if (!c) {
clear();
Expand All @@ -179,6 +178,8 @@ class string
(uintptr_t)c >= (uintptr_t)(str.data()) &&
(uintptr_t)c < (uintptr_t)(str.data() + str.size()));
}

if ((void *)c == (void *)c_str()) return *this;

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

0 comments on commit 0e5b3ec

Please sign in to comment.