diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-10-16 01:02:12 +0000 |
---|---|---|
committer | andreas <andreas@daaaf23c-2e50-4459-9457-1e69db5a47bf> | 2014-10-16 01:02:12 +0000 |
commit | 97f6ec9bbb3615c9a505e29c76b7ecc6993b6791 (patch) | |
tree | 3cf25e87f848502af527bd6fbfbf72c4ae27ab36 /src | |
parent | 0e426ff6dfb960c105908a437c435924e59eb822 (diff) |
fixed typeo in RangeSet, added unit test for Variant
git-svn-id: file:///var/local/svn/basicwriter@59 daaaf23c-2e50-4459-9457-1e69db5a47bf
Diffstat (limited to 'src')
-rw-r--r-- | src/core/model/RangeSet.hpp | 10 | ||||
-rw-r--r-- | src/core/script/Variant.hpp | 2 |
2 files changed, 6 insertions, 6 deletions
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<T> &r) const + bool overlaps(const Range<T> &r) const { return (((r.start >= start) || (r.end >= start)) && ((r.start <= end) || (r.end <= end))); @@ -208,7 +208,7 @@ protected: std::set<Range<T>, RangeComp<T>> 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: |