aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.h
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2014-04-22 09:59:10 +1000
committerNeil Hodgson <nyamatongwe@gmail.com>2014-04-22 09:59:10 +1000
commitee2e64f273fc1b44273ee61edbde6c159ee4c080 (patch)
tree0634e67ac56468ec7c1b271760ad614cfeb8f422 /src/Document.h
parent35508dddb38e44175092828e813aa73a9596a278 (diff)
downloadscintilla-mirror-ee2e64f273fc1b44273ee61edbde6c159ee4c080.tar.gz
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.
Diffstat (limited to 'src/Document.h')
-rw-r--r--src/Document.h8
1 files changed, 8 insertions, 0 deletions
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) {