Website Summary Files Commits Branches @commit @diff @stats
path: root / src / String
diff options
context:
space:
mode:
1 files changed, 5 insertions, 5 deletions
-rw-r--r--src/String/String.cpp10
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;
}