From: Kristian Høgsberg Date: Thu, 20 Sep 2007 03:24:57 +0000 (-0400) Subject: Add comment about how to implement package addition faster. X-Git-Tag: 0.1~324 X-Git-Url: http://project.juiblex.co.uk/git/?a=commitdiff_plain;h=cf3a197adbecefa1b812405cd0688a73b11e06d2;p=razor2.git%2F.git Add comment about how to implement package addition faster. --- diff --git a/razor.c b/razor.c index 873bd61..31405de 100644 --- a/razor.c +++ b/razor.c @@ -990,6 +990,18 @@ add_package(struct razor_importer *importer, * package indexes. Returns a newly allocated package set. Does not * enforce validity of the resulting package set. */ +/* FIXME: We can do this in a linear sweep instead of using an + * importer and the sorting that incurs: build the new package list + * sorted, build up a map from package index in old set to package + * index in new set for both sets. ~0 means 'not in new set'. build + * new string pool as we go, probably just re-use that part of the + * importer. as we build the package list, fill out a bitvector of + * the properties that are referenced by the pacakges in the new + * set. then do a parallel loop through the properties and emit them + * to the new set and build a map from indices in the old set to + * indices in the new set. then loop through the packages again and + * emit the property lists. */ + struct razor_set * razor_set_add(struct razor_set *set, struct razor_set *upstream, struct array *packages)