From 16e61cdf82317805ba5449bbb4c05f94df35e64d Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 31 Oct 2019 15:56:20 +0100 Subject: Utils: Simplify bugprone-branch-clone readability-simplify-boolean-expr Change-Id: I75ad6118275ad9231f21b578567c3c042414263b Reviewed-by: hjk Reviewed-by: Eike Ziller --- src/libs/utils/differ.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/libs/utils/differ.cpp') diff --git a/src/libs/utils/differ.cpp b/src/libs/utils/differ.cpp index 16fc0ced01..74ec99c78c 100644 --- a/src/libs/utils/differ.cpp +++ b/src/libs/utils/differ.cpp @@ -236,16 +236,12 @@ static int cleanupSemanticsScore(const QString &text1, const QString &text2) static bool isWhitespace(const QChar &c) { - if (c == ' ' || c == '\t') - return true; - return false; + return c == ' ' || c == '\t'; } static bool isNewLine(const QChar &c) { - if (c == '\n') - return true; - return false; + return c == '\n'; } /* @@ -719,9 +715,7 @@ static bool diffWithWhitespaceExpandedInEqualities(const QList &leftInput, return false; *rightOutput = decodeExpandedWhitespace(rightDiffList, commonRightCodeMap, &ok); - if (!ok) - return false; - return true; + return ok; } static void appendWithEqualitiesSquashed(const QList &leftInput, -- cgit v1.2.1