[Zope] ZCatalog results.

Sidnei da Silva sidnei@x3ng.com.br
Mon, 25 Feb 2002 13:35:29 -0300


Something like this, i presume. 

seen = {}
unique = []
for r in result:
  if not seen.has_key(r.data_record_id_):
    seen[r.data_record_id_] = r.data_record_id_
    unique.append(r)

return unique

It works OK. Thanx everyone. 

Em Dom 24 Fev 2002 12:12, Oleg Broytmann escreveu:
> On Sun, Feb 24, 2002 at 12:46:03PM +0100, Frank Tegtmeyer wrote:
> > >    Instead of "seen" just use dictionary.
> >
> > Which dictionary do you mean? Or was meant "just use a dictionary"?
>
>    Yes, just use a dictionary. Hash lookups are *much* faster than linear
> search that "in" does.
>
> Oleg.

-- 
Sidnei da Silva
X3ng Web Technology
sidnei@x3ng.com.br