From 07966845584a6e76e3c14d2ef5126668681cd189 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 8 Aug 2013 12:56:47 +0200 Subject: [PATCH] CustomParser: Improve strange operator != implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I42c195004a9eca9f03cf34bd274f473ed87c580e Reviewed-by: André Hartmann Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/customparser.cpp | 14 +++----------- src/plugins/projectexplorer/customparser.h | 3 ++- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index 15aebda4877..3622f24994e 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -43,18 +43,10 @@ CustomParserSettings::CustomParserSettings() : messageCap(3) { } -bool CustomParserSettings::operator !=(const CustomParserSettings &other) const +bool CustomParserSettings::operator ==(const CustomParserSettings &other) const { - if (errorPattern == other.errorPattern) - return false; - if (fileNameCap == other.fileNameCap) - return false; - if (lineNumberCap == other.lineNumberCap) - return false; - if (messageCap == other.messageCap) - return false; - - return true; + return errorPattern == other.errorPattern && fileNameCap == other.fileNameCap + && lineNumberCap == other.lineNumberCap && messageCap == other.messageCap; } CustomParser::CustomParser(const CustomParserSettings &settings) : diff --git a/src/plugins/projectexplorer/customparser.h b/src/plugins/projectexplorer/customparser.h index 0aece8a8e6a..933826a023b 100644 --- a/src/plugins/projectexplorer/customparser.h +++ b/src/plugins/projectexplorer/customparser.h @@ -43,7 +43,8 @@ class CustomParserSettings public: CustomParserSettings(); - bool operator !=(const CustomParserSettings &other) const; + bool operator ==(const CustomParserSettings &other) const; + bool operator !=(const CustomParserSettings &other) const { return !operator==(other); } QString errorPattern; int fileNameCap;