aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'text.c')
-rw-r--r--text.c3
1 files changed, 1 insertions, 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);
}