From 5560bd06cd3eaeb5739690cd34354985bc948a96 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Mon, 10 Mar 2025 15:15:41 -0400 Subject: move str_replace_end to str.h --- main.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d9cbd44..8336728 100644 --- a/main.c +++ b/main.c @@ -201,14 +201,6 @@ BlockList blk_gather(Str src, Arena *perm) { #define Ot(a, s, b) Os(a), O(s), Os(b) #define Otl(a, f, b) for (Line *l = blk->lines; l; l = l->next) Ot(a, f, b) -Str str_replace_end(Str s, Str a, Str b, Arena *m) { - if (!str_ends(s, a)) return s; - char *p = new_arr(m, char, s.n + b.n - a.n); - memcpy(p, s.s, s.n - a.n); - memcpy(p + s.n - a.n, b.s, b.n); - return (Str) { p, s.n + b.n - a.n }; -} - void str_cat_blk(Str *out, Block *blk, Arena *perm, Arena *scratch) { switch (blk->type) { case LN_CODE: -- cgit 1.4.1-2-gfad0