Skip to content
Snippets Groups Projects
Commit 0750ff30 authored by mattijs's avatar mattijs
Browse files

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

parent ced53919
No related merge requests found
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -198,7 +198,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
// Write end delimiter
os << token::END_BLOCK;
}
else if (Size < 11 && contiguous<T>())
else if (Size <= 1 ||(Size < 11 && contiguous<T>()))
{
// Write start delimiter
os << token::BEGIN_LIST;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -67,7 +67,7 @@ Foam::Ostream& Foam::operator<<
// Write end delimiter
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
os << L.size() << token::BEGIN_LIST;
......
......@@ -92,7 +92,7 @@ Foam::Ostream& Foam::operator<<(Foam::Ostream& os, const Foam::UList<T>& L)
// Write end delimiter
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
os << L.size() << token::BEGIN_LIST;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment