From d8f31f6dede79d1c915251df466c3bc374b26cd6 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 22 Nov 2017 12:04:45 +0100 Subject: [PATCH] STYLE: use HashTable ternary-like lookup in argList --- src/OpenFOAM/global/argList/argList.C | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 840b03cddc..1f2a8c1af6 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -729,14 +729,13 @@ void Foam::argList::parse // 2. environment var FOAM_FILEHANDLER // 3. etc/controlDict optimisationSwitches 'fileHandler' // 4. system/controlDict 'fileHandler' (not handled here; done in TimeIO.C) + // 5. '-fileHandler' commmand-line option { - word handlerType(getEnv("FOAM_FILEHANDLER")); - HashTable::const_iterator iter = options_.find("fileHandler"); - if (iter != options_.end()) - { - handlerType = iter(); - } + word handlerType + ( + options_.lookup("fileHandler", getEnv("FOAM_FILEHANDLER")) + ); if (handlerType.empty()) {