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

This commit is contained in:
Mark Olesen
2018-01-17 14:20:30 +01:00
parent 17b82e5e7e
commit 29c066d21e

View File

@ -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;
}