aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-02-08 15:53:39 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-02-08 18:33:32 +0100
commitcebb24b36ac45cc7c6912481cacd29ef9d5c68b9 (patch)
tree7067e0ace5cff699584d9c869b2c8bb380beff38
parent18e0c03c3f3bda24e05c5200b53fe95f9b33475b (diff)
downloadvis-cebb24b36ac45cc7c6912481cacd29ef9d5c68b9.tar.gz
vis-cebb24b36ac45cc7c6912481cacd29ef9d5c68b9.tar.xz
text: remove special case for marks at start of file
Unlike EOF address 0 needs no special treatment.
-rw-r--r--text.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/text.c b/text.c
index b0517bb..8dc6d97 100644
--- a/text.c
+++ b/text.c
@@ -1628,8 +1628,6 @@ size_t text_lineno_by_pos(Text *txt, size_t pos) {
}
Mark text_mark_set(Text *txt, size_t pos) {
- if (pos == 0)
- return (Mark)&txt->begin;
if (pos == txt->size)
return (Mark)&txt->end;
Location loc = piece_get_extern(txt, pos);
@@ -1643,8 +1641,6 @@ size_t text_mark_get(Text *txt, Mark mark) {
if (mark == EMARK)
return EPOS;
- if (mark == (Mark)&txt->begin)
- return 0;
if (mark == (Mark)&txt->end)
return txt->size;