From 237246527155276da68f0691c4d2ea5a2fef7497 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Tue, 22 Apr 2014 09:59:10 +1000 Subject: Hoisting some calculations into classes: ContractionState::DisplayLastFromDoc Range::First and Range::Last. Changing Editor::RectangleFromRange arguments to a Range. Simplifying code and specifying some local variables as const. --- src/Document.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Document.h') diff --git a/src/Document.h b/src/Document.h index d73715764..e2414bd36 100644 --- a/src/Document.h +++ b/src/Document.h @@ -43,6 +43,14 @@ public: return (start != invalidPosition) && (end != invalidPosition); } + Position First() const { + return (start <= end) ? start : end; + } + + Position Last() const { + return (start > end) ? start : end; + } + // Is the position within the range? bool Contains(Position pos) const { if (start < end) { -- cgit v1.2.3