mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Simplify checking of container (List/HashTable, strings) sizes
- can use 'XX.empty()' instead of 'XX.size() == 0', 'XX.size() < 1' or 'XX.size() <= 0' or for simpler coding. It also has the same number of characters as '!XX.size()' and /might/ be more readable - many size checking had 'XX.size() > 0', 'XX.size() != 0', or 'XX.size() >= 1' when a simple 'XX.size()' suffices
This commit is contained in:
@ -49,9 +49,9 @@ void readNASEdges
|
||||
edgeList& allEdges
|
||||
)
|
||||
{
|
||||
IFstream OBJfile(inFileName);
|
||||
IFstream is(inFileName);
|
||||
|
||||
if (!OBJfile.good())
|
||||
if (!is.good())
|
||||
{
|
||||
FatalErrorIn("readNASEdges")
|
||||
<< "Cannot read file " << inFileName
|
||||
@ -68,14 +68,14 @@ void readNASEdges
|
||||
DynamicList<label> edgeIndices;
|
||||
|
||||
|
||||
while (OBJfile.good())
|
||||
while (is.good())
|
||||
{
|
||||
string line;
|
||||
OBJfile.getLine(line);
|
||||
is.getLine(line);
|
||||
|
||||
if (line.size() > 0 && line[0] == '$')
|
||||
if (line.empty() || line[0] == '$')
|
||||
{
|
||||
// Skip comment
|
||||
// Skip empty and comment
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -87,9 +87,9 @@ void readNASEdges
|
||||
while (true)
|
||||
{
|
||||
string buf;
|
||||
OBJfile.getLine(buf);
|
||||
is.getLine(buf);
|
||||
|
||||
if (buf.size() > 72 && buf[72]=='+')
|
||||
if (buf.size() > 72 && buf[72] == '+')
|
||||
{
|
||||
line += buf.substr(8, 64);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user