Fix bug in Ordering code where it keeps on increasing nVar even the insert is not successful.

release/4.3a0
Duy-Nguyen Ta 2010-10-21 23:02:40 +00:00
parent 812e3277ee
commit 5c68a07738
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,8 @@ public:
iterator insert(const Symbol& key, Index order) { return insert(std::make_pair(key,order)); }
std::pair<iterator,bool> tryInsert(const value_type& key_order) {
std::pair<iterator,bool> it_ok(order_.insert(key_order));
if(key_order.second+1 > nVars_) nVars_ = key_order.second+1;
if(it_ok.second == true && key_order.second+1 > nVars_)
nVars_ = key_order.second+1;
return it_ok; }
std::pair<iterator,bool> tryInsert(const Symbol& key, Index order) { return tryInsert(std::make_pair(key,order)); }