From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eigenstate.org ([206.124.132.107]) by ewsd; Fri Nov 22 12:59:36 EST 2019 Received: from eigenstate.org (localhost [127.0.0.1]) by eigenstate.org (OpenSMTPD) with ESMTP id cf4c756c; Fri, 22 Nov 2019 09:59:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=eigenstate.org; h= message-id:to:subject:date:from:in-reply-to:mime-version :content-type:content-transfer-encoding; s=mail; bh=7R+lOrKWN3p5 TWJiujaQ3CtaOg8=; b=SlfhBOIDg3fsy7dTslGPs4j6vB6asNX3t8TKoPlIWWOy c2mS0F3WZ06O433dpVe/uTeTlBYG7HUdMihcZ8aUQ6yAtlxqYQOvpsOH/mxOQpHg 7QzbDBOj5M3pf31SEmDirT4BFwEqKpcocT7GDyrCZ864Kj9soGohXobGjjVYDQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=eigenstate.org; h=message-id :to:subject:date:from:in-reply-to:mime-version:content-type :content-transfer-encoding; q=dns; s=mail; b=Ia7JZ9n/XfJLjWMOUrt ZG7Ojihb/lDQk5X5KAFDkp2n5siQwaqJ4q3WdbqyRhlWE7qbSDq/ihX6JkYKcju5 Bw4v7UQtFUh2n/BuwKp35T0yHoXeVxEZf/fiT8mDhXTlxqxCyMIOaWES5FSu7u5g rG2e8BHZK/pmXPXmMUzhu6d8= Received: from abbatoir.hsd1.ca.comcast.net (c-76-21-119-139.hsd1.ca.comcast.net [76.21.119.139]) by eigenstate.org (OpenSMTPD) with ESMTPSA id 5d0059a2 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Fri, 22 Nov 2019 09:59:35 -0800 (PST) Message-ID: <878813FD7637AE05DF929E5C28B3CAD1@eigenstate.org> To: cinap_lenrek@felloff.net, 9front@9front.org Subject: Re: [9front] fix ref822 Date: Fri, 22 Nov 2019 09:59:34 -0800 From: ori@eigenstate.org In-Reply-To: 4F2E28EFD56B89BE598EA209856361F5@felloff.net 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: transactional lossless HTTP over AJAX persistence storage > 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. The comment implied that other mail clients will mistakenly give us duplicate refrences -- I don't know if we're guaranteed that they'll all be together, so this may not be quite right either. > delete uniquearray() and instead just do it like this: > > a = m->references; > n = tokenize(f, ....); > > for(i=0; i for(j=0; j if(a[j] == nil || strcmp(a[j], f[i]) == 0) > break; > } > if(j == Nref){ > // handle full case, shift a by one > } > > // now a[j] can be: nil = slot free, > a[j] = f[i]; // put into array > } > > -- > cinap