From 1a761be10d4838ff6b78a133ed5262b7ee904561 Mon Sep 17 00:00:00 2001 From: Daniel Burrows Date: Sat, 6 Jun 2009 19:59:32 -0700 Subject: 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. --- src/generic/problemresolver/problemresolver.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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."); -- cgit v1.2.3