Actually, it was an unmeasured, cargo cult microoptimization; when you do
the lookup in desired_object(), if foo in bar is linear for lists, but
constant time for dicts and sets. I doubt the runtime difference is
measurable, but like a wobbly table, once I noticed it I couldn't not see
it and it started to bug me.

On Tue, Jan 15, 2013 at 10:52 PM, Jason Bau <notifications@github.com>wrote:

> In main/courses/views.py:
>
> >              cg2_t = cg2.get_content_type()
> > -            level2_items.setdefault(cg2_t, []).append(getattr(cg2, cg2_t).id)
> > +            level2_items.setdefault(cg2_t, set([])).add(getattr(cg2, cg2_t).id)
>
> why a set([])? To enforce uniqueness, I suppose?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Stanford-Online/class2go/pull/1898/files#r2661776>.
>
>