Skip to content
Snippets Groups Projects
Commit 9965c500 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: minor improvement when writing list entry

parent ce121c92
No related branches found
No related tags found
No related merge requests found
......@@ -138,12 +138,10 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
template<class T, unsigned Size>
void Foam::FixedList<T, Size>::writeEntry(Ostream& os) const
{
if
(
token::compound::isCompound("List<" + word(pTraits<T>::typeName) + '>')
)
const word tag = "List<" + word(pTraits<T>::typeName) + '>';
if (token::compound::isCompound(tag))
{
os << word("List<" + word(pTraits<T>::typeName) + '>') << " ";
os << tag << " ";
}
os << *this;
......
......@@ -219,7 +219,7 @@ public:
//- Copy elements of the given UList
void deepCopy(const UList<T>&);
//- Write the UList as a dictionary entry
//- Write the UList with its compound type
void writeEntry(Ostream&) const;
//- Write the UList as a dictionary entry with keyword
......
......@@ -34,16 +34,13 @@ License
template<class T>
void Foam::UList<T>::writeEntry(Ostream& os) const
{
if
(
size()
&& token::compound::isCompound
(
"List<" + word(pTraits<T>::typeName) + '>'
)
)
if (size())
{
os << word("List<" + word(pTraits<T>::typeName) + '>') << " ";
const word tag = "List<" + word(pTraits<T>::typeName) + '>';
if (token::compound::isCompound(tag))
{
os << tag << ' ';
}
}
os << *this;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment