From adae257fc2cd71108b6b5e88a04e894359c26180 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 25 Apr 2022 17:12:08 +0300 Subject: Autocommit at 25.04.2022 @ 17:12 --- src/String/String.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/String/String.cpp') diff --git a/src/String/String.cpp b/src/String/String.cpp index ee9c9df..72db76c 100644 --- a/src/String/String.cpp +++ b/src/String/String.cpp @@ -46,10 +46,12 @@ String::~String() { } String::String(String&& other) { - moveFrom(other); + str = other.str; + other.str = nullptr; + length = other.length; } -String& String::operator=(const String& other) { +String& String::operator=(String&& other) { if (this != &other) { free(); moveFrom(other); -- cgit v1.3.1-23-gd82d