mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-02 01:31:14 +00:00
Use dtor + placement new in assignment operator.
The change was used to simplify the code. A member was not copied and that was noticed by cppcheck.
This commit is contained in:
parent
35f0d72454
commit
b099e7c752
@ -60,11 +60,8 @@ map_labels::~map_labels()
|
||||
map_labels& map_labels::operator=(const map_labels& other)
|
||||
{
|
||||
if(this != &other) {
|
||||
team_ = other.team_;
|
||||
|
||||
config cfg;
|
||||
other.write(cfg);
|
||||
read(cfg);
|
||||
this->~map_labels();
|
||||
new (this) map_labels(other);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user