FixedList: Corrected checkSize

Resolves bug-report http://bugs.openfoam.org/view.php?id=2178
This commit is contained in:
Henry Weller
2016-08-03 19:45:31 +01:00
parent 449a4e7353
commit 777bc83d14
2 changed files with 3 additions and 7 deletions

View File

@ -140,10 +140,10 @@ inline void Foam::FixedList<T, Size>::checkStart(const label start) const
template<class T, unsigned Size> template<class T, unsigned Size>
inline void Foam::FixedList<T, Size>::checkSize(const label size) const inline void Foam::FixedList<T, Size>::checkSize(const label size) const
{ {
if (size < 0 || unsigned(size) > Size) if (unsigned(size) != Size)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "size " << size << " out of range 0 ... " << (Size) << "size " << size << " != " << Size
<< abort(FatalError); << abort(FatalError);
} }
} }

View File

@ -138,11 +138,7 @@ void Foam::FixedList<T, Size>::writeEntry(Ostream& os) const
{ {
if if
( (
size() token::compound::isCompound("List<" + word(pTraits<T>::typeName) + '>')
&& token::compound::isCompound
(
"List<" + word(pTraits<T>::typeName) + '>'
)
) )
{ {
os << word("List<" + word(pTraits<T>::typeName) + '>') << " "; os << word("List<" + word(pTraits<T>::typeName) + '>') << " ";