Faster parse frag
This commit is contained in:
parent
318a5fddf5
commit
3cbd3d196d
10
src/modal.c
10
src/modal.c
|
@ -228,10 +228,12 @@ parse_frag(char **side, char *s)
|
||||||
if(c == ')' || (c == '<' || c == '>'))
|
if(c == ')' || (c == '<' || c == '>'))
|
||||||
*side = ∅
|
*side = ∅
|
||||||
else {
|
else {
|
||||||
int wrapped;
|
cap = walk(s), *side = dict_;
|
||||||
*side = dict_, cap = walk(s), wrapped = c == '(';
|
if(c == '(')
|
||||||
if(wrapped) s++, cap--;
|
dict_ = copy(s + 1, dict_, cap - s - 2);
|
||||||
dict_ = copy(s, dict_, cap - s), s = cap + wrapped, *dict_++ = 0;
|
else
|
||||||
|
dict_ = copy(s, dict_, cap - s);
|
||||||
|
s = cap, *dict_++ = 0;
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue