[Lemon-commits] [lemon_svn] deba: r2282 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:51:29 CET 2006
Author: deba
Date: Wed Nov 2 16:26:04 2005
New Revision: 2282
Modified:
hugo/trunk/lemon/fib_heap.h
Log:
Some change on the clear
Modified: hugo/trunk/lemon/fib_heap.h
==============================================================================
--- hugo/trunk/lemon/fib_heap.h (original)
+++ hugo/trunk/lemon/fib_heap.h Wed Nov 2 16:26:04 2005
@@ -116,9 +116,11 @@
/// \brief Make empty this heap.
///
/// Make empty this heap.
- void clear() {
- for (int i = 0; i < (int)container.size(); ++i) {
- iimap[container[i].name] = -2;
+ void clear() {
+ if (num_items != 0) {
+ for (int i = 0; i < (int)container.size(); ++i) {
+ iimap[container[i].name] = -2;
+ }
}
container.clear(); minimum = 0; num_items = 0;
}
More information about the Lemon-commits
mailing list