Re: Slow memory allocation
- Posted by Haflidi Asgrimsson <haflidi at prokaria.com> Jun 12, 2005
- 574 views
Except Kparses stops parsing and returns empty list. So I wrote my own function and it parses my file in 3 seconds:
function mySplit(string s_input, sequence s_char) sequence l_return, s_return integer n_start, n_stop atom a_char if equal(s_char, "#") then a_char = '!' else a_char = '#' end if l_return = {} n_start = 1 while TRUE do n_stop = match(s_char, s_input) if n_stop then s_input[n_stop] = a_char s_return = s_input[n_start..n_stop-1] l_return = append(l_return, s_return) n_start = n_stop+1 else l_return = append(l_return, s_input[n_start..$]) exit end if end while return l_return end function
Tank you all for trying to help