File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -48,32 +48,26 @@ namespace gd {
48
48
49
49
string& string::operator =(string const & other) {
50
50
if (this != &other) {
51
- impl.free ();
52
51
impl.setStorage (other);
53
52
}
54
53
return *this ;
55
54
}
56
55
string& string::operator =(string&& other) {
57
56
// TODO: do this better :-)
58
- impl.free ();
59
57
impl.setStorage (other);
60
- implFor (other).free ();
61
58
implFor (other).setEmpty ();
62
59
return *this ;
63
60
}
64
61
string& string::operator =(char const * other) {
65
- impl.free ();
66
62
impl.setStorage (other);
67
63
return *this ;
68
64
}
69
65
string& string::operator =(std::string const & other) {
70
- impl.free ();
71
66
impl.setStorage (other);
72
67
return *this ;
73
68
}
74
69
75
70
void string::clear () {
76
- impl.free ();
77
71
impl.setEmpty ();
78
72
}
79
73
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ void setEmptyInternalString(gd::string* str) {
82
82
83
83
namespace geode ::stl {
84
84
void StringImpl::setEmpty () {
85
+ this ->free ();
86
+
85
87
data.m_data = emptyInternalString ();
86
88
}
87
89
You can’t perform that action at this time.
0 commit comments