From 3d32c4cfcba728c89b19f9d907858853ae2bfdc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 23 Oct 2020 13:07:53 +0200 Subject: text: simplify iterator_init This was added in c240368d5da8208c15e0263034384414d938afb3 to work around a possibly bogus tis-interpreter warning regarding multiple accesses in the same expression. --- text.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/text.c b/text.c index 51cb442..c61115e 100644 --- a/text.c +++ b/text.c @@ -799,14 +799,13 @@ bool text_mmaped(const Text *txt, const char *ptr) { } static bool iterator_init(Iterator *it, size_t pos, Piece *p, size_t off) { - Iterator iter = (Iterator){ + *it = (Iterator){ .pos = pos, .piece = p, .start = p ? p->data : NULL, .end = p && p->data ? p->data + p->len : NULL, .text = p && p->data ? p->data + off : NULL, }; - *it = iter; return text_iterator_valid(it); } -- cgit v1.2.3