mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support predicate checks for argList (similar to dictionary methods)
- Favour use of argList methods that are more similar to dictionary
method names with the aim of reducing the cognitive load.
* Silently deprecate two-parameter get() method in favour of the
more familiar getOrDefault.
* Silently deprecate opt() method in favour of get()
These may be verbosely deprecated in future versions.
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -93,10 +93,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
const label maxOut = Foam::max(0, args.get<label>("max", 0));
|
||||
const label span = Foam::max(1, args.get<label>("span", 1));
|
||||
const label maxOut = Foam::max(0, args.getOrDefault<label>("max", 0));
|
||||
const label span = Foam::max(1, args.getOrDefault<label>("span", 1));
|
||||
|
||||
const scalar relax = args.get<scalar>("scale", 1);
|
||||
const scalar relax = args.getOrDefault<scalar>("scale", 1);
|
||||
|
||||
const bool slave = args.found("slave");
|
||||
const bool removeLock = args.found("removeLock");
|
||||
|
||||
Reference in New Issue
Block a user