add guards for corner cases

This commit is contained in:
conrad
2022-09-26 15:53:46 +10:00
parent d45089d9aa
commit a153dcbb16
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -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; }
+2
View File
@@ -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;