diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C index 171c9e074e..198383ce40 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -36,7 +36,7 @@ License template void Foam::FixedList::writeEntry(Ostream& os) const { - const word tag = "List<" + word(pTraits::typeName) + '>'; + const word tag("List<" + word(pTraits::typeName) + '>'); if (token::compound::isCompound(tag)) { os << tag << token::SPACE; diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H index 4ae56710b7..b9ae065c13 100644 --- a/src/OpenFOAM/containers/Lists/List/List.H +++ b/src/OpenFOAM/containers/Lists/List/List.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -45,11 +45,8 @@ SourceFiles #include "UList.H" #include "autoPtr.H" -#include "one.H" #include "SLListFwd.H" -#include - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H index 259aa076c9..19c8321dcd 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.H +++ b/src/OpenFOAM/containers/Lists/UList/UList.H @@ -49,6 +49,7 @@ SourceFiles #include "label.H" #include "uLabel.H" #include "zero.H" +#include "one.H" #include "contiguous.H" #include "nullObject.H" #include "stdFoam.H" diff --git a/src/OpenFOAM/containers/Lists/UList/UListIO.C b/src/OpenFOAM/containers/Lists/UList/UListIO.C index 81a6fad37f..b5369cdb9f 100644 --- a/src/OpenFOAM/containers/Lists/UList/UListIO.C +++ b/src/OpenFOAM/containers/Lists/UList/UListIO.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016-2019 OpenCFD Ltd. + Copyright (C) 2016-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -37,13 +37,14 @@ License template void Foam::UList::writeEntry(Ostream& os) const { + const word tag("List<" + word(pTraits::typeName) + '>'); + if (token::compound::isCompound(tag)) + { + os << tag << token::SPACE; + } + if (size()) { - const word tag = "List<" + word(pTraits::typeName) + '>'; - if (token::compound::isCompound(tag)) - { - os << tag << token::SPACE; - } os << *this; } else if (os.format() == IOstream::ASCII)