From cf3a197adbecefa1b812405cd0688a73b11e06d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 19 Sep 2007 23:24:57 -0400 Subject: [PATCH] Add comment about how to implement package addition faster. --- razor.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) 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) -- 1.7.1