mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: minor improvement when writing list entry
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user