diff options
author | Daniel Burrows <dburrows@debian.org> | 2009-06-06 19:59:32 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2009-06-06 19:59:32 -0700 |
commit | 1a761be10d4838ff6b78a133ed5262b7ee904561 (patch) | |
tree | 78aa9d732b4ecac9f0ae12dc7adff2e06759dd5b | |
parent | 0a3084a3a70d28e35c8b691a3ac02f732609aabe (diff) | |
download | aptitude-1a761be10d4838ff6b78a133ed5262b7ee904561.tar.gz |
Don't try to insert empty promotions into the promotion set.
Lots of empty promotions appear to get generated during the course of
the search, and the promotion set doesn't handle them properly. They
aren't very interesting (you hardly ever have any valuable knowledge
about the empty set), and they sit around eating memory.
-rw-r--r-- | src/generic/problemresolver/problemresolver.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/generic/problemresolver/problemresolver.h b/src/generic/problemresolver/problemresolver.h index 8ea6d5ab..413b1c19 100644 --- a/src/generic/problemresolver/problemresolver.h +++ b/src/generic/problemresolver/problemresolver.h @@ -1198,7 +1198,9 @@ private: */ void add_promotion(const promotion &p) { - if(promotions.insert(p) != promotions.end()) + if(p.get_choices().size() == 0) + LOG_TRACE(logger, "Ignoring the empty promotion " << p); + else if(promotions.insert(p) != promotions.end()) { LOG_TRACE(logger, "Added the promotion " << p << " to the global promotion set; preparing to apply it to all active steps."); |