From d34414b4287eeda8914eb224becd1da2898f2025 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 23 Nov 2016 10:25:09 +0100 Subject: [PATCH] Make some variables const Change-Id: If0b6939d2c8446526f6d779486776bbea62fbc67 Reviewed-by: Eike Ziller --- src/plugins/diffeditor/differ.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/diffeditor/differ.cpp b/src/plugins/diffeditor/differ.cpp index a79fe9ffbfb..c46277b22b6 100644 --- a/src/plugins/diffeditor/differ.cpp +++ b/src/plugins/diffeditor/differ.cpp @@ -209,16 +209,16 @@ static int cleanupSemanticsScore(const QString &text1, const QString &text2) if (!text1.count() || !text2.count()) // Edges return 6; - QChar char1 = text1[text1.count() - 1]; - QChar char2 = text2[0]; - bool nonAlphaNumeric1 = !char1.isLetterOrNumber(); - bool nonAlphaNumeric2 = !char2.isLetterOrNumber(); - bool whitespace1 = nonAlphaNumeric1 && char1.isSpace(); - bool whitespace2 = nonAlphaNumeric2 && char2.isSpace(); - bool lineBreak1 = whitespace1 && char1.category() == QChar::Other_Control; - bool lineBreak2 = whitespace2 && char2.category() == QChar::Other_Control; - bool blankLine1 = lineBreak1 && blankLineEnd.indexIn(text1) != -1; - bool blankLine2 = lineBreak2 && blankLineStart.indexIn(text2) != -1; + const QChar char1 = text1[text1.count() - 1]; + const QChar char2 = text2[0]; + const bool nonAlphaNumeric1 = !char1.isLetterOrNumber(); + const bool nonAlphaNumeric2 = !char2.isLetterOrNumber(); + const bool whitespace1 = nonAlphaNumeric1 && char1.isSpace(); + const bool whitespace2 = nonAlphaNumeric2 && char2.isSpace(); + const bool lineBreak1 = whitespace1 && char1.category() == QChar::Other_Control; + const bool lineBreak2 = whitespace2 && char2.category() == QChar::Other_Control; + const bool blankLine1 = lineBreak1 && blankLineEnd.indexIn(text1) != -1; + const bool blankLine2 = lineBreak2 && blankLineStart.indexIn(text2) != -1; if (blankLine1 || blankLine2) // Blank lines return 5;