X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fchanges.h;h=967a9a6c8d7bc6308827ba632a311068b3c778b4;hb=cd4033aef3a3f1efdb5a676b8bab3d367f53a830;hp=e2f0e9d4b801d52e166b0ae9b496d4f2b299966b;hpb=8c2010510680f238605998b875b6b3d824fcd35b;p=lyx.git diff --git a/src/changes.h b/src/changes.h index e2f0e9d4b8..967a9a6c8d 100644 --- a/src/changes.h +++ b/src/changes.h @@ -67,7 +67,7 @@ public: /// /// return the change at the given pos - Change const lookup(pos_type pos) const; + Change const & lookup(pos_type pos) const; /// return true if there is a change in the given range (excluding end) bool isChanged(pos_type start, pos_type end) const; @@ -89,11 +89,15 @@ private: Range(pos_type s, pos_type e) : start(s), end(e) {} - // does this range contain r ? - bool contains(Range const & r) const; + // does this range contain r ? (inlined as the result of profiling) + bool contains(Range const & r) const { + return r.start >= start && r.end <= end; + } - // does this range contain pos ? - bool contains(pos_type pos) const; + // does this range contain pos ? (inlined as the result of profiling) + bool contains(pos_type pos) const { + return pos >= start && pos < end; + } // do the ranges intersect ? bool intersects(Range const & r) const;