From 97f6ec9bbb3615c9a505e29c76b7ecc6993b6791 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 16 Oct 2014 01:02:12 +0000 Subject: fixed typeo in RangeSet, added unit test for Variant git-svn-id: file:///var/local/svn/basicwriter@59 daaaf23c-2e50-4459-9457-1e69db5a47bf --- src/core/model/RangeSet.hpp | 10 +++++----- src/core/script/Variant.hpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core/model/RangeSet.hpp b/src/core/model/RangeSet.hpp index ef86363..841d476 100644 --- a/src/core/model/RangeSet.hpp +++ b/src/core/model/RangeSet.hpp @@ -97,13 +97,13 @@ struct Range { } /** - * Checks whether the given range overlapps with another range. Not that + * Checks whether the given range overlaps with another range. Not that * this check is only meaningful if both ranges are valid. * * @param r is the range that should be checked for overlapping with this * range. */ - bool overlapps(const Range &r) const + bool overlaps(const Range &r) const { return (((r.start >= start) || (r.end >= start)) && ((r.start <= end) || (r.end <= end))); @@ -208,7 +208,7 @@ protected: std::set, RangeComp> ranges; /** - * Returns an iterator to the first element in the ranges list that overlapps + * Returns an iterator to the first element in the ranges list that overlaps * with the given range. * * @param r is the range for which the first overlapping element should be @@ -229,7 +229,7 @@ protected: } // Iterate until an overlapping element is found - while (!(it->overlapps(r) || (allowNeighbours && it->neighbours(r))) + while (!(it->overlaps(r) || (allowNeighbours && it->neighbours(r))) && (it != ranges.end())) { it++; } @@ -247,7 +247,7 @@ public: // Calculate a new range that covers both the new range and all old // ranges in the set -- delete all old elements on the way auto it = firstOverlapping(r, true); - while ((it->overlapps(r) || it->neighbours(r)) && it != ranges.end()) { + while ((it->overlaps(r) || it->neighbours(r)) && it != ranges.end()) { r = r.merge(*it); it = ranges.erase(it); } diff --git a/src/core/script/Variant.hpp b/src/core/script/Variant.hpp index 208bfa5..b2b650b 100644 --- a/src/core/script/Variant.hpp +++ b/src/core/script/Variant.hpp @@ -233,7 +233,7 @@ public: } } - std::string getStringValue() const + const std::string& getStringValue() const { switch (type) { case VariantType::string: -- cgit v1.2.3