From de9a1a23a4dc02c26636238a23a1d1c873c9f487 Mon Sep 17 00:00:00 2001 From: Norbert Grunwald <Norbert.Grunwald@ufz.de> Date: Mon, 9 Sep 2019 07:24:36 +0200 Subject: [PATCH] removed else after return --- MaterialLib/MPL/Properties/IdealGasLaw.cpp | 35 ++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/MaterialLib/MPL/Properties/IdealGasLaw.cpp b/MaterialLib/MPL/Properties/IdealGasLaw.cpp index 27f4d387000..9348ee5513e 100644 --- a/MaterialLib/MPL/Properties/IdealGasLaw.cpp +++ b/MaterialLib/MPL/Properties/IdealGasLaw.cpp @@ -71,16 +71,15 @@ PropertyDataType IdealGasLaw::dValue(VariableArray const& variable_array, return -pressure * molar_mass / gas_constant / temperature / temperature; } - else if (primary_variable == Variable::phase_pressure) + + if (primary_variable == Variable::phase_pressure) { return molar_mass / gas_constant / temperature; } - else - { - OGS_FATAL( - "IdealGasLaw::dValue is implemented for derivatives " - "with respect to phase pressure or temperature only."); - } + + OGS_FATAL( + "IdealGasLaw::dValue is implemented for derivatives " + "with respect to phase pressure or temperature only."); return 0.; } @@ -104,27 +103,25 @@ PropertyDataType IdealGasLaw::d2Value(VariableArray const& variable_array, // d2rho_dp2 return 0.; } - else if ((primary_variable1 == Variable::temperature) && - (primary_variable2 == Variable::temperature)) + if ((primary_variable1 == Variable::temperature) && + (primary_variable2 == Variable::temperature)) { // d2rho_dT2 return 2. * molar_mass * pressure / gas_constant / temperature / temperature / temperature; } - else if (((primary_variable1 == Variable::phase_pressure) && - (primary_variable2 == Variable::temperature)) || - ((primary_variable1 == Variable::temperature) && - (primary_variable2 == Variable::phase_pressure))) + if (((primary_variable1 == Variable::phase_pressure) && + (primary_variable2 == Variable::temperature)) || + ((primary_variable1 == Variable::temperature) && + (primary_variable2 == Variable::phase_pressure))) { // d2rho_dpdT or d2rho_dTdp return -molar_mass / gas_constant / temperature / temperature; } - else - { - OGS_FATAL( - "IdealGasLaw::d2Value is implemented for derivatives " - "with respect to phase pressure and temperature only."); - } + + OGS_FATAL( + "IdealGasLaw::d2Value is implemented for derivatives " + "with respect to phase pressure and temperature only."); return 0.; } -- GitLab