aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-11-02 14:31:49 +0100
committerMarc André Tanner <mat@brain-dump.org>2020-11-13 11:41:44 +0100
commitf95cf946cebf75bacaa130d3268e2010b5e07746 (patch)
treefe28aa688478d7673019949761cdd26de214c15e /sam.c
parent2a4edf973fe21ba370318f0c509ea261f3e7b28d (diff)
downloadvis-f95cf946cebf75bacaa130d3268e2010b5e07746.tar.gz
vis-f95cf946cebf75bacaa130d3268e2010b5e07746.tar.xz
sam: simplify boolean expression, start < end implies end > 0
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sam.c b/sam.c
index b1be53b..b1061fc 100644
--- a/sam.c
+++ b/sam.c
@@ -1012,7 +1012,7 @@ static Filerange address_line_evaluate(Address *addr, File *file, Filerange *ran
size_t start = range->start, end = range->end, line;
if (sign > 0) {
char c;
- if (start < end && end > 0 && text_byte_get(txt, end-1, &c) && c == '\n')
+ if (start < end && text_byte_get(txt, end-1, &c) && c == '\n')
end--;
line = text_lineno_by_pos(txt, end);
line = text_pos_by_lineno(txt, line + offset);