slen() is not needed to get lenght of rule data
This commit is contained in:
parent
170cfde437
commit
44b04fa893
11
src/modal.c
11
src/modal.c
|
@ -22,15 +22,6 @@ copy(char *src, char *dst, int length)
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
slen(char *s)
|
|
||||||
{
|
|
||||||
char *cap = s;
|
|
||||||
while(*cap++)
|
|
||||||
;
|
|
||||||
return cap - s;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
walk(char *s)
|
walk(char *s)
|
||||||
{
|
{
|
||||||
|
@ -272,8 +263,8 @@ static void
|
||||||
remove_rule(Rule *r)
|
remove_rule(Rule *r)
|
||||||
{
|
{
|
||||||
if(r < rules_ - 1) {
|
if(r < rules_ - 1) {
|
||||||
int distance = slen(r->a) + slen(r->b);
|
|
||||||
char *memsrc = (r + 1)->a;
|
char *memsrc = (r + 1)->a;
|
||||||
|
int distance = (r + 1)->a - r->a;
|
||||||
copy(memsrc, r->a, dict_ - memsrc);
|
copy(memsrc, r->a, dict_ - memsrc);
|
||||||
while(r < rules_ - 1) {
|
while(r < rules_ - 1) {
|
||||||
Rule *next = r + 1;
|
Rule *next = r + 1;
|
||||||
|
|
Loading…
Reference in New Issue