SmallString: Improve self-assignment behaviour

This commit is contained in:
chaoticgd
2026-03-15 23:39:55 +00:00
committed by Ty
parent 6aed46c603
commit d049c395fc
3 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -392,7 +392,8 @@ void SmallStringBase::vsprintf(const char* format, va_list ap)
void SmallStringBase::assign(const SmallStringBase& copy)
{
assign(copy.c_str(), copy.length());
if (this != &copy)
assign(copy.c_str(), copy.length());
}
void SmallStringBase::assign(const char* str)