From 280965fe22fbbd00400df55c4e2c0da86a9d0e75 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@dune-project.org> Date: Tue, 29 May 2012 15:56:57 +0000 Subject: [PATCH] remove some redundant tests: unsigned ints are always nonnegative [[Imported from SVN: r1608]] --- dune/istl/bcrsmatrix.hh | 7 ------- dune/istl/bvector.hh | 4 +--- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh index 9d52b5f18..823fc1b82 100644 --- a/dune/istl/bcrsmatrix.hh +++ b/dune/istl/bcrsmatrix.hh @@ -778,8 +778,6 @@ namespace Dune { size_type total=0; for (size_type i=0; i<n; i++) { - if (r[i].getsize()<0) - DUNE_THROW(ISTLError,"rowsize must be nonnegative"); total += r[i].getsize(); } @@ -860,11 +858,6 @@ namespace Dune { { ColIterator endj = (*i).end(); for (ColIterator j=(*i).begin(); j!=endj; ++j) { - if (j.index()<0) - { - std::cout << "j[" << j.offset() << "]=" << j.index() << std::endl; - DUNE_THROW(ISTLError,"undefined index detected"); - } if (j.index()>=m) { dwarn << "WARNING: size of row "<< i.index()<<" is "<<j.offset()<<". But was specified as being "<< (*i).end().offset() <<". This means you are wasting valuable space and creating additional cache misses!"<<std::endl; diff --git a/dune/istl/bvector.hh b/dune/istl/bvector.hh index 0339b8add..d8b7f610d 100644 --- a/dune/istl/bvector.hh +++ b/dune/istl/bvector.hh @@ -388,9 +388,7 @@ namespace Dune { if(size > block_vector_unmanaged<B,A>::N()) if(capacity_ < size) this->reserve(size, copyOldValues); - - if(size >=0) - this->n=size; + this->n = size; } -- GitLab