mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
up
This commit is contained in:
parent
8008f131fb
commit
b7e45ac2d2
@ -41,20 +41,16 @@ namespace pkpy{
|
|||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr& operator=(const shared_ptr& other) {
|
shared_ptr& operator=(const shared_ptr& other) {
|
||||||
if (this != &other) {
|
|
||||||
_dec_counter();
|
_dec_counter();
|
||||||
counter = other.counter;
|
counter = other.counter;
|
||||||
_inc_counter();
|
_inc_counter();
|
||||||
}
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr& operator=(shared_ptr&& other) noexcept {
|
shared_ptr& operator=(shared_ptr&& other) noexcept {
|
||||||
if (this != &other) {
|
|
||||||
_dec_counter();
|
_dec_counter();
|
||||||
counter = other.counter;
|
counter = other.counter;
|
||||||
other.counter = nullptr;
|
other.counter = nullptr;
|
||||||
}
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,13 +99,11 @@ namespace pkpy {
|
|||||||
const PyVar& operator[](uint8_t i) const { return _args[i]; }
|
const PyVar& operator[](uint8_t i) const { return _args[i]; }
|
||||||
|
|
||||||
ArgList& operator=(ArgList&& other) noexcept {
|
ArgList& operator=(ArgList&& other) noexcept {
|
||||||
if(this != &other){
|
|
||||||
__tryRelease();
|
__tryRelease();
|
||||||
this->_args = other._args;
|
this->_args = other._args;
|
||||||
this->_size = other._size;
|
this->_size = other._size;
|
||||||
other._args = nullptr;
|
other._args = nullptr;
|
||||||
other._size = 0;
|
other._size = 0;
|
||||||
}
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user