summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-05-14 13:58:19 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-05-14 13:58:19 +0200
commit2b12b72d6ef834bf2f732b38bf62d680666d5885 (patch)
tree3c2925a4bffdb0cf4790f572f547297048fd0488 /src
parent42be2b23cac2dc2627bd3cadeaf38aef714f53a1 (diff)
fix overlaps(Range, Range)
Diffstat (limited to 'src')
-rw-r--r--src/selection.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/selection.hh b/src/selection.hh
index e5361a4d..dd28bc51 100644
--- a/src/selection.hh
+++ b/src/selection.hh
@@ -41,8 +41,8 @@ private:
inline bool overlaps(const Range& lhs, const Range& rhs)
{
- return (lhs.first() <= rhs.first() and lhs.last() >= rhs.first()) or
- (lhs.first() <= rhs.last() and lhs.last() >= rhs.last());
+ return lhs.begin() <= rhs.begin() ? lhs.end() > rhs.begin()
+ : lhs.begin() < rhs.end();
}
inline bool touches(const Range& lhs, const Range& rhs)