ENH: List: Output of zero or single element non-contiguous lists

This commit is contained in:
mattijs
2013-10-31 13:58:34 +00:00
parent ced5391952
commit 0750ff309b
3 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -198,7 +198,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
// Write end delimiter // Write end delimiter
os << token::END_BLOCK; os << token::END_BLOCK;
} }
else if (Size < 11 && contiguous<T>()) else if (Size <= 1 ||(Size < 11 && contiguous<T>()))
{ {
// Write start delimiter // Write start delimiter
os << token::BEGIN_LIST; os << token::BEGIN_LIST;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -67,7 +67,7 @@ Foam::Ostream& Foam::operator<<
// Write end delimiter // Write end delimiter
os << token::END_BLOCK; os << token::END_BLOCK;
} }
else if (L.size() < 11 && contiguous<T>()) else if(L.size() <= 1 || (L.size() < 11 && contiguous<T>()))
{ {
// Write size and start delimiter // Write size and start delimiter
os << L.size() << token::BEGIN_LIST; os << L.size() << token::BEGIN_LIST;

View File

@ -92,7 +92,7 @@ Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
// Write end delimiter // Write end delimiter
os << token::END_BLOCK; os << token::END_BLOCK;
} }
else if (L.size() == 1 || (L.size() < 11 && contiguous<T>())) else if (L.size() <= 1 || (L.size() < 11 && contiguous<T>()))
{ {
// Write size and start delimiter // Write size and start delimiter
os << L.size() << token::BEGIN_LIST; os << L.size() << token::BEGIN_LIST;