From cebb24b36ac45cc7c6912481cacd29ef9d5c68b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 8 Feb 2017 15:53:39 +0100 Subject: text: remove special case for marks at start of file Unlike EOF address 0 needs no special treatment. --- text.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'text.c') 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; -- cgit v1.2.3