From 777bc83d14305b281fd2e4ca66c1042e4b96aa1b Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 3 Aug 2016 19:45:31 +0100 Subject: [PATCH] FixedList: Corrected checkSize Resolves bug-report http://bugs.openfoam.org/view.php?id=2178 --- src/OpenFOAM/containers/Lists/FixedList/FixedListI.H | 4 ++-- src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H index 0b0daf1d71..dd3c6c6546 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H @@ -140,10 +140,10 @@ inline void Foam::FixedList::checkStart(const label start) const template inline void Foam::FixedList::checkSize(const label size) const { - if (size < 0 || unsigned(size) > Size) + if (unsigned(size) != Size) { FatalErrorInFunction - << "size " << size << " out of range 0 ... " << (Size) + << "size " << size << " != " << Size << abort(FatalError); } } diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C index 2bf821a369..9119234ef6 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C @@ -138,11 +138,7 @@ void Foam::FixedList::writeEntry(Ostream& os) const { if ( - size() - && token::compound::isCompound - ( - "List<" + word(pTraits::typeName) + '>' - ) + token::compound::isCompound("List<" + word(pTraits::typeName) + '>') ) { os << word("List<" + word(pTraits::typeName) + '>') << " ";