From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from duke.felloff.net ([216.126.196.34]) by ewsd; Fri Nov 22 02:22:23 EST 2019 Message-ID: <4F2E28EFD56B89BE598EA209856361F5@felloff.net> Date: Fri, 22 Nov 2019 08:21:54 +0100 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] fix ref822 In-Reply-To: 3538A24A05D19F1D333569AA901FA1E4@eigenstate.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: leveraged rails CSS pipelining module-oriented locator i think this is also wrong: + if(i + n > Nref){ + for(i = 0; i < n; i++) + free(a[i]); + for(i = n; i < Nref; i++) + a[i - n] = a[i]; } i is number of entries in a[], n is number of entries in f[]. if we got like i = 1 and n = Nref, we'd want to remove 1 item from a because: i + n - Nref == 1 + Nref - Nref == 1 also, i think the uniqarray() approach is wrong. we probably want to deduplicate while we insert into a. we should never populate m->references with duplicate items in the first place. delete uniquearray() and instead just do it like this: a = m->references; n = tokenize(f, ....); for(i=0; i