From e4f642b9464dc8664ff8dfcaee04b7f952811b2b Mon Sep 17 00:00:00 2001 From: Wilfredo Rodriguez Date: Thu, 18 Oct 2018 17:02:46 -0400 Subject: [PATCH] Remove redundant bool variable and else before a return --- src/display/curve.cpp | 20 +++++++++++--------- src/display/grayscale.cpp | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/display/curve.cpp b/src/display/curve.cpp index 211eaaa531..33578236f2 100644 --- a/src/display/curve.cpp +++ b/src/display/curve.cpp @@ -324,16 +324,15 @@ SPCurve::is_closed() const { if (is_empty()) { return false; - } else { - bool closed = true; - for (Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) { - if ( ! it->closed() ) { - closed = false; - break; - } + } + + for (Geom::PathVector::const_iterator it = _pathv.begin(); it != _pathv.end(); ++it) { + if ( ! it->closed() ) { + return false; } - return closed; } + + return true; } /** @@ -344,9 +343,12 @@ SPCurve::is_equal(SPCurve * other) const { if(other == nullptr) { return false; - } else if(_pathv == other->get_pathvector()){ + } + + if(_pathv == other->get_pathvector()){ return true; } + return false; } diff --git a/src/display/grayscale.cpp b/src/display/grayscale.cpp index 5978dbf2a8..a8e3fb3900 100644 --- a/src/display/grayscale.cpp +++ b/src/display/grayscale.cpp @@ -84,9 +84,9 @@ unsigned char luminance(unsigned char r, unsigned char g, unsigned char b) { bool activeDesktopIsGrayscale() { if (SP_ACTIVE_DESKTOP) { return (SP_ACTIVE_DESKTOP->getColorMode() == Inkscape::COLORMODE_GRAYSCALE); - } else { - return false; } + + return false; } -- GitLab