From 2745471226354a4c94d9ac02a85298587efebf7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 29 Dec 2010 19:02:42 +0100 Subject: [PATCH] Don't even try to assign self to self. --- src/Math/Matrix.h | 2 +- src/Math/Vector.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Math/Matrix.h b/src/Math/Matrix.h index 6929866e8..3d14ad051 100644 --- a/src/Math/Matrix.h +++ b/src/Math/Matrix.h @@ -58,7 +58,7 @@ template class Matrix { /** @brief Assignment operator */ inline Matrix& operator=(const Matrix& other) { - setData(other.data()); + if(&other != this) setData(other.data()); return *this; } diff --git a/src/Math/Vector.h b/src/Math/Vector.h index e7c709b10..e5af334d4 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -52,7 +52,7 @@ template class Vector { /** @brief Assignment operator */ inline Vector& operator=(const Vector& other) { - setData(other.data()); + if(&other != this) setData(other.data()); return *this; }