From 44b04fa8933224e208be4e7d169c2edaf5801e32 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 21 May 2024 20:09:15 -0700 Subject: [PATCH] slen() is not needed to get lenght of rule data --- src/modal.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/modal.c b/src/modal.c index df6f2f4..5dcd970 100644 --- a/src/modal.c +++ b/src/modal.c @@ -22,15 +22,6 @@ copy(char *src, char *dst, int length) return dst; } -static int -slen(char *s) -{ - char *cap = s; - while(*cap++) - ; - return cap - s; -} - static char * walk(char *s) { @@ -272,8 +263,8 @@ static void remove_rule(Rule *r) { if(r < rules_ - 1) { - int distance = slen(r->a) + slen(r->b); char *memsrc = (r + 1)->a; + int distance = (r + 1)->a - r->a; copy(memsrc, r->a, dict_ - memsrc); while(r < rules_ - 1) { Rule *next = r + 1;