mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use dictionary findDict() instead of isDict() + subDict()
- avoids redundant dictionary searching STYLE: remove dictionary lookupOrDefaultCompat wrapper - deprecated and replaced by getOrDefaultCompat (2019-05). The function is usually specific to internal keyword upgrading (version compatibility) and unlikely to exist in any user code.
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2022 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -252,7 +252,9 @@ Foam::functionObjects::energyTransport::energyTransport
|
||||
{
|
||||
const word& key = iter().keyword();
|
||||
|
||||
if (!multiphaseThermo_.isDict(key))
|
||||
const dictionary* subDictPtr = multiphaseThermo_.findDict(key);
|
||||
|
||||
if (!subDictPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Found non-dictionary entry " << iter()
|
||||
@ -260,7 +262,7 @@ Foam::functionObjects::energyTransport::energyTransport
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const dictionary& dict = multiphaseThermo_.subDict(key);
|
||||
const dictionary& dict = *subDictPtr;
|
||||
|
||||
phaseNames_[phasei] = key;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user