Commit 78656821 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/unreachable_codes_due_to_wrong_assert_position' into 'master'

Resolve "Two unreachable code sections"

Closes #1030

See merge request !2609

(cherry picked from commit d3f97928)

0c533588 [bugfix] Fix the assert position
parent 4f012bd0
......@@ -176,9 +176,9 @@ private:
static constexpr int phaseIdx(int brinePhaseIdx) { return liquidPhaseIdx; }
static constexpr int compIdx(int brineCompIdx)
{
assert(brineCompIdx == VariableSalinityBrine::H2OIdx || brineCompIdx == VariableSalinityBrine::NaClIdx);
switch (brineCompIdx)
{
assert(brineCompIdx == VariableSalinityBrine::H2OIdx || brineCompIdx == VariableSalinityBrine::NaClIdx);
case VariableSalinityBrine::H2OIdx: return BrineOrH2OIdx;
case VariableSalinityBrine::NaClIdx: return NaClIdx;
default: return 0; // this will never be reached, only needed to suppress compiler warning
......
......@@ -228,13 +228,10 @@ private:
static constexpr int phaseIdx(int brinePhaseIdx) { return wPhaseIdx; }
static constexpr int compIdx(int brineCompIdx)
{
assert( brineCompIdx == Brine::H2OIdx || brineCompIdx == Brine::NaIdx
|| brineCompIdx == Brine::ClIdx || brineCompIdx == Brine::CaIdx);
switch (brineCompIdx)
{
assert(brineCompIdx == Brine::H2OIdx
|| brineCompIdx == Brine::NaIdx
|| brineCompIdx == Brine::ClIdx
|| brineCompIdx == Brine::CaIdx
);
case Brine::H2OIdx: return H2OIdx;
case Brine::NaIdx: return NaIdx;
case Brine::ClIdx: return ClIdx;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment