From 9160dad6ba2d5f29ef09cda875aa8018096431cd Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 6 Aug 2018 20:44:58 +0200 Subject: [PATCH] COMP: silence compiler warning --- src/OpenFOAM/primitives/Pair/PairI.H | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/primitives/Pair/PairI.H b/src/OpenFOAM/primitives/Pair/PairI.H index 2f489a0380..cf59a79fec 100644 --- a/src/OpenFOAM/primitives/Pair/PairI.H +++ b/src/OpenFOAM/primitives/Pair/PairI.H @@ -118,23 +118,21 @@ inline const T& Foam::Pair::other(const T& a) const if (first() == second()) { FatalErrorInFunction - << "Call to other only valid for Pair with differing" - << " elements:" << *this << abort(FatalError); + << "Call to other only valid for Pair with differing elements:" + << *this << abort(FatalError); } else if (a == first()) { return second(); } - else + else if (a != second()) { - if (a != second()) - { - FatalErrorInFunction - << "Pair " << *this - << " does not contain " << a << abort(FatalError); - } - return first(); + FatalErrorInFunction + << "Pair " << *this + << " does not contain " << a << abort(FatalError); } + + return first(); }