summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilfredo Rodriguez <wilfredor@gmail.com>2018-10-18 21:02:46 +0000
committerWilfredo Rodriguez <wilfredor@gmail.com>2018-10-22 20:32:12 +0000
commite4f642b9464dc8664ff8dfcaee04b7f952811b2b (patch)
tree1ff2a22e625d9df548e7c2c251002f0b9ecfcf6d /src
parentfix masked object's selection bbox (diff)
downloadinkscape-e4f642b9464dc8664ff8dfcaee04b7f952811b2b.tar.gz
inkscape-e4f642b9464dc8664ff8dfcaee04b7f952811b2b.zip
Remove redundant bool variable and else before a return
Diffstat (limited to 'src')
-rw-r--r--src/display/curve.cpp20
-rw-r--r--src/display/grayscale.cpp4
2 files changed, 13 insertions, 11 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 211eaaa53..33578236f 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 5978dbf2a..a8e3fb390 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;
}