From ce1612d3bd336c35c8b0aa213b19c94ae73873a6 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Fri, 21 Jun 2019 20:46:08 +0200
Subject: [PATCH] Readability: Remove else after return in if-cnd.

---
 Applications/DataHolderLib/BoundaryCondition.cpp      |  8 ++++----
 .../LinearConcentrationAndPressureDependentDensity.h  |  5 +----
 MathLib/KelvinVector.cpp                              | 11 ++++-------
 ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h       |  2 +-
 4 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/Applications/DataHolderLib/BoundaryCondition.cpp b/Applications/DataHolderLib/BoundaryCondition.cpp
index c5b4abbae49..06d5ecd2f95 100644
--- a/Applications/DataHolderLib/BoundaryCondition.cpp
+++ b/Applications/DataHolderLib/BoundaryCondition.cpp
@@ -28,11 +28,11 @@ BoundaryCondition::ConditionType BoundaryCondition::convertStringToType(
     {
         return ConditionType::DIRICHLET;
     }
-    else if (str == "Neumann")
+    if (str == "Neumann")
     {
         return ConditionType::NEUMANN;
     }
-    else if (str == "Robin")
+    if (str == "Robin")
     {
         return ConditionType::ROBIN;
     }
@@ -46,11 +46,11 @@ std::string BoundaryCondition::convertTypeToString(ConditionType type)
     {
         return "Dirichlet";
     }
-    else if (type == ConditionType::NEUMANN)
+    if (type == ConditionType::NEUMANN)
     {
         return "Neumann";
     }
-    else if (type == ConditionType::ROBIN)
+    if (type == ConditionType::ROBIN)
     {
         return "Robin";
     }
diff --git a/MaterialLib/Fluid/Density/LinearConcentrationAndPressureDependentDensity.h b/MaterialLib/Fluid/Density/LinearConcentrationAndPressureDependentDensity.h
index 963be12861f..dbf8f02b8b2 100644
--- a/MaterialLib/Fluid/Density/LinearConcentrationAndPressureDependentDensity.h
+++ b/MaterialLib/Fluid/Density/LinearConcentrationAndPressureDependentDensity.h
@@ -93,10 +93,7 @@ public:
             return _reference_density *
                    _fluid_density_pressure_difference_ratio;
         }
-        else
-        {
-            return 0;
-        }
+        return 0;
     }
 
 private:
diff --git a/MathLib/KelvinVector.cpp b/MathLib/KelvinVector.cpp
index 49fba2c3897..575b0334403 100644
--- a/MathLib/KelvinVector.cpp
+++ b/MathLib/KelvinVector.cpp
@@ -173,13 +173,10 @@ kelvinVectorToSymmetricTensor(Eigen::Matrix<double,
     {
         return kelvinVectorToSymmetricTensor<6>(v);
     }
-    else
-    {
-        OGS_FATAL(
-            "Kelvin vector to tensor conversion expected an input vector of "
-            "size 4 or 6, but a vector of size %d was given.",
-            v.size());
-    }
+    OGS_FATAL(
+        "Kelvin vector to tensor conversion expected an input vector of size 4 "
+        "or 6, but a vector of size %d was given.",
+        v.size());
 }
 }  // namespace KelvinVector
 }  // namespace MathLib
diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h
index 36172c27fcf..e682adc78a2 100644
--- a/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h
+++ b/ProcessLib/ThermoMechanics/ThermoMechanicsFEM.h
@@ -190,7 +190,7 @@ public:
         {
             return setEpsilon(values);
         }
-        else if (name == "epsilon_m_ip")
+        if (name == "epsilon_m_ip")
         {
             return setEpsilonMechanical(values);
         }
-- 
GitLab