equal
deleted
inserted
replaced
114 bool empty() const { return num_items==0; } |
114 bool empty() const { return num_items==0; } |
115 |
115 |
116 /// \brief Make empty this heap. |
116 /// \brief Make empty this heap. |
117 /// |
117 /// |
118 /// Make empty this heap. |
118 /// Make empty this heap. |
119 void clear() { |
119 void clear() { |
120 for (int i = 0; i < (int)container.size(); ++i) { |
120 if (num_items != 0) { |
121 iimap[container[i].name] = -2; |
121 for (int i = 0; i < (int)container.size(); ++i) { |
|
122 iimap[container[i].name] = -2; |
|
123 } |
122 } |
124 } |
123 container.clear(); minimum = 0; num_items = 0; |
125 container.clear(); minimum = 0; num_items = 0; |
124 } |
126 } |
125 |
127 |
126 /// \brief \c item gets to the heap with priority \c value independently |
128 /// \brief \c item gets to the heap with priority \c value independently |