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

Use first() and last() methods in primitiveEntry.

parent 3f0b6ec8
Branches
Tags
No related merge requests found
...@@ -60,34 +60,39 @@ Foam::primitiveEntry::primitiveEntry ...@@ -60,34 +60,39 @@ Foam::primitiveEntry::primitiveEntry
Foam::label Foam::primitiveEntry::startLineNumber() const Foam::label Foam::primitiveEntry::startLineNumber() const
{ {
if (size()) const tokenList& tokens = *this;
if (tokens.empty())
{ {
return operator[](0).lineNumber(); return -1;
} }
else else
{ {
return -1; return tokens.first().lineNumber();
} }
} }
Foam::label Foam::primitiveEntry::endLineNumber() const Foam::label Foam::primitiveEntry::endLineNumber() const
{ {
if (size()) const tokenList& tokens = *this;
if (tokens.empty())
{ {
return operator[](size()-1).lineNumber(); return -1;
} }
else else
{ {
return -1; return tokens.last().lineNumber();
} }
} }
Foam::ITstream& Foam::primitiveEntry::stream() const Foam::ITstream& Foam::primitiveEntry::stream() const
{ {
ITstream& dataStream = const_cast<primitiveEntry&>(*this); ITstream& is = const_cast<primitiveEntry&>(*this);
dataStream.rewind(); is.rewind();
return dataStream; return is;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment