Code review comment for lp:~stevenk/launchpad/distroseries-spec-preload

Revision history for this message
William Grant (wgrant) wrote :

125 - for work_item in self.work_items:
126 + for work_item in self._work_items:
127 if (work_item.title not in title_counts or

Can't this use the cached version?

267 + for specid in work_items_by_spec.keys():
268 + work_items_by_spec[specid].sort(key=lambda wi: wi.sequence)
269 + for workitem in work_items_by_spec[specid]:
270 + get_property_cache(workitem.specification).work_items.append(
271 + workitem)

This seems needlessly circuitous. get_property_cache(spec).work_items = list(sorted(work_items_by_spec[specid], key=lambda wi: wi.sequence))?

review: Approve (code)

« Back to merge proposal