From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 342AB1388B6 for ; Tue, 5 Jan 2016 05:36:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 21855E0883; Tue, 5 Jan 2016 05:36:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8163CE0882 for ; Tue, 5 Jan 2016 05:36:16 +0000 (UTC) Received: from [192.168.0.12] (ip68-5-185-102.oc.oc.cox.net [68.5.185.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id E8D3D3408FB for ; Tue, 5 Jan 2016 05:36:13 +0000 (UTC) Subject: Re: [gentoo-portage-dev] [PATCH] repoman: filter out duplicate dependencies in error messages To: gentoo-portage-dev@lists.gentoo.org References: <1451943030-20380-1-git-send-email-vapier@gentoo.org> From: Zac Medico X-Enigmail-Draft-Status: N1110 Message-ID: <568B5640.7040102@gentoo.org> Date: Mon, 4 Jan 2016 21:36:00 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <1451943030-20380-1-git-send-email-vapier@gentoo.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Archives-Salt: 1d56123f-55d4-4ef6-89b5-714590633a2e X-Archives-Hash: fab4efde9da0d6cfa8d111c0e5f21e78 On 01/04/2016 01:30 PM, Mike Frysinger wrote: > + # Filter out duplicates. We do this by hand (rather > + # than use a set) so the order is stable and better > + # matches the order that's in the ebuild itself. > + atoms = [] > + for atom in all_atoms: > + if atom not in atoms: > + atoms.append(atom) > + Alternative implementation using OrderedDict which has O(1) average complexity for containment checks, rather than O(N): atoms = OrderedDict() for atom in all_atoms: atoms.setdefault(atom, atom) atoms = list(atoms) -- Thanks, Zac