mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: avoid raw dictionary lookup in functionObjects (issue #762)
Style changes:
- use lookupObjectRef instead of using const_cast
- use tmp::New factory
This commit is contained in:
@ -90,15 +90,15 @@ bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
|
||||
if (dict.found("field"))
|
||||
{
|
||||
objectNames_.setSize(1);
|
||||
dict.lookup("field") >> objectNames_[0];
|
||||
dict.readEntry("field", objectNames_[0]);
|
||||
}
|
||||
else if (dict.found("fields"))
|
||||
{
|
||||
dict.lookup("fields") >> objectNames_;
|
||||
dict.readEntry("fields", objectNames_);
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.lookup("objects") >> objectNames_;
|
||||
dict.readEntry("objects", objectNames_);
|
||||
}
|
||||
|
||||
writeOption_ = writeOptionNames_.lookupOrDefault
|
||||
|
||||
Reference in New Issue
Block a user