From 966939a70ed7ad11b7414881ce96585e4cebfd2b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 7 Mar 2023 14:53:09 -0700 Subject: [PATCH] Simplify a ?: expression. --- examples/step-22/step-22.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index aac858b7ac..93096930d2 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -202,7 +202,15 @@ namespace Step22 ExcIndexRange(component, 0, this->n_components)); if (component == 0) - return (p[0] < 0 ? -1 : (p[0] > 0 ? 1 : 0)); + { + if (p[0] < 0) + return -1; + else if (p[0] > 0) + return 1; + else + return 0; + } + return 0; } -- 2.39.5