summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/2geom/generic-interval.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/2geom/generic-interval.h b/src/2geom/generic-interval.h
index 41eaf59b0..f6d4718de 100644
--- a/src/2geom/generic-interval.h
+++ b/src/2geom/generic-interval.h
@@ -274,10 +274,12 @@ public:
/** @brief Union with another interval, gracefully handling empty ones. */
void unionWith(GenericOptInterval<C> const &a) {
- if (*this) { // check that we are not empty
- (*this)->unionWith(*a);
- } else if (a) {
- *this = *a;
+ if (a) {
+ if (*this) { // check that we are not empty
+ (*this)->unionWith(*a);
+ } else {
+ *this = *a;
+ }
}
}
void intersectWith(GenericOptInterval<C> const &o) {