STYLE: avoid unrestricted dictionary lookup in conversion, sampling, surfMesh

- aids with detection of excess tokens (issue #762)

- deprecated dictionary::operator[] in favour of the lookup() method
  which offers more flexibilty and clarity of purpose.
  Additionally, the read<> and get<> forms should generally be used
  instead anyhow.
This commit is contained in:
Mark Olesen
2018-07-18 13:33:00 +02:00
parent 956abe3f38
commit a592ebc073
59 changed files with 158 additions and 262 deletions

View File

@ -21,23 +21,8 @@
if (io.typeHeaderOk<IOdictionary>(true))
{
IOdictionary timeObject
(
IOobject
(
"time",
runTime.timeName(),
"uniform",
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
label index;
timeObject.lookup("index") >> index;
timeName = Foam::name(index);
const label timeIndex = IOdictionary(io).get<label>("index");
timeName = Foam::name(timeIndex);
}
else
{
@ -46,4 +31,3 @@
}
Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl;