Commit 29c066d2 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: avoid redundant eof check in UIPstream (issue #676)

parent 17b82e5e
......@@ -106,18 +106,17 @@ inline Foam::Istream& Foam::UIPstream::readStringFromBuffer(std::string& str)
size_t len;
readFromBuffer(len);
if (len == 0)
if (len)
{
str.clear();
str.assign(&externalBuf_[externalBufPosition_], len);
externalBufPosition_ += len;
checkEof();
}
else
{
str.assign(&externalBuf_[externalBufPosition_], len);
str.clear();
}
externalBufPosition_ += len;
checkEof();
return *this;
}
......
Supports Markdown
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