From d05c3bad41bf17013f6d94fd3c712fed88f4faa5 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Mon, 29 Aug 2005 11:08:08 +0000 Subject: [PATCH] FIX resize: avoid unitialised assignment warning for data_=data; Hopefully the 'if' clause does not effect efficiency on modern architectures svn path=/trunk/boost/boost/numeric/ublas/; revision=30718 --- include/boost/numeric/ublas/storage.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index 38b444e9..4d2f5937 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -161,14 +161,12 @@ namespace boost { namespace numeric { namespace ublas { } alloc_.deallocate (data_, size_); } -#ifdef NDEBUG - data_ = data; -#else - // simplify debugging by giving data_ a definate value + if (size) data_ = data; +#ifndef NDEBUG else - data_ = 0; + data_ = 0; // simplify debugging by giving data_ a definate value #endif size_ = size; }