add guards for corner cases
This commit is contained in:
@@ -198,6 +198,8 @@ MapMat<eT>::operator=(MapMat<eT>&& x)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
|
||||
if(this == &x) { return; }
|
||||
|
||||
reset();
|
||||
|
||||
if(map_ptr) { delete map_ptr; }
|
||||
|
||||
@@ -427,6 +427,8 @@ field<oT>::operator=(field<oT>&& X)
|
||||
{
|
||||
arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X);
|
||||
|
||||
if(this == &X) { return *this; }
|
||||
|
||||
reset();
|
||||
|
||||
access::rw(n_rows ) = X.n_rows;
|
||||
|
||||
Reference in New Issue
Block a user