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:
@ -235,7 +235,7 @@ static void createFieldNames
|
||||
HashSet<word> surfScalarHash;
|
||||
HashSet<word> surfVectorHash;
|
||||
|
||||
if (setName.size() == 0)
|
||||
if (setName.empty())
|
||||
{
|
||||
forAll(Times, timeI)
|
||||
{
|
||||
@ -536,13 +536,12 @@ void user_query_file_function
|
||||
fileName caseName(rootAndCase.name());
|
||||
|
||||
// handle trailing '/'
|
||||
if (caseName.size() == 0)
|
||||
if (caseName.empty())
|
||||
{
|
||||
caseName = rootDir.name();
|
||||
rootDir = rootDir.path();
|
||||
rootDir = rootDir.path();
|
||||
}
|
||||
|
||||
|
||||
Info<< "rootDir : " << rootDir << endl
|
||||
<< "caseName : " << caseName << endl
|
||||
<< "setName : " << setName << endl;
|
||||
|
||||
Reference in New Issue
Block a user