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:
Mark Olesen
2022-09-28 09:24:46 +02:00
parent 9d5a3a5c54
commit 55f5f8774b
14 changed files with 110 additions and 116 deletions

View File

@ -60,18 +60,16 @@ int main(int argc, char *argv[])
)
).subDict("volumetricBSplinesMotionSolverCoeffs")
);
// Read box names and allocate size
wordList controlBoxes(NURBSdict.toc());
for (const word& boxName : controlBoxes)
for (const entry& dEntry : NURBSdict)
{
if (NURBSdict.isDict(boxName))
if (dEntry.isDict())
{
// Creating an object writes the control points in the
// constructor
NURBS3DVolume::New
(void) NURBS3DVolume::New
(
NURBSdict.subDict(boxName),
dEntry.dict(),
mesh,
false // do not compute parametric coordinates
);