From da94de676f20e33b6fa1ad9705eaaee8d9bcd79b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 25 Apr 2022 17:17:10 +0300 Subject: Autocommit at 25.04.2022 @ 17:17 --- src/String/String.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/String') diff --git a/src/String/String.cpp b/src/String/String.cpp index 72db76c..5169146 100644 --- a/src/String/String.cpp +++ b/src/String/String.cpp @@ -14,9 +14,7 @@ void String::copyFrom(const String& other) { } void String::moveFrom(String&& other) { - str = other.str; - other.str = nullptr; - length = other.length; + } /* Public */ @@ -53,8 +51,10 @@ String::String(String&& other) { String& String::operator=(String&& other) { if (this != &other) { - free(); - moveFrom(other); + delete[] str; + str = other.str; + other.str = nullptr; + length = other.length; } return *this; } -- cgit v1.3.1-23-gd82d