From e9326924f28d4dfcaf35d691195149829642d77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 22 Dec 2011 15:49:05 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20en=20commentaire=20d'un=20ASSERT=20qui?= =?UTF-8?q?=20faisait=20des=20acc=C3=A8s=20m=C3=A9moire=20non=20initialis?= =?UTF-8?q?=C3=A9s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- heap.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/heap.cpp b/heap.cpp index 42d2f94..1c044a0 100644 --- a/heap.cpp +++ b/heap.cpp @@ -6,14 +6,14 @@ Heap::Heap() void Heap::init(int id, int factor) { this->id = id; this->factor = factor; } void Heap::insert(float key, Chose* value) { - { // DEBUG - int _d_node = value->lod.heaps[id]; - if (_d_node <= lastNode && _d_node >= 0 && - buckets[getBucket(_d_node)][getIndex(_d_node)].value == value) { - std::cout << "ERROR ! Trying to insert " << value; - std::cout << " but it is already here." << std::endl; - } - } + // { // DEBUG + // int _d_node = value->lod.heaps[id]; + // if (_d_node <= lastNode && _d_node >= 0 && + // buckets[getBucket(_d_node)][getIndex(_d_node)].value == value) { + // std::cout << "ERROR ! Trying to insert " << value; + // std::cout << " but it is already here." << std::endl; + // } + // } ++lastNode; if (getBucket(lastNode) > lastAllocatedBucket) { allocateBucket(); @@ -26,13 +26,13 @@ void Heap::insert(float key, Chose* value) { void Heap::remove(Chose* value) { int node = value->lod.heaps[id]; - { // DEBUG - if (buckets[getBucket(node)][getIndex(node)].value != value) { - std::cout << "ERROR ! Trying to remove " << value; - std::cout << " but found " << buckets[getBucket(node)][getIndex(node)].value; - std::cout << std::endl; - } - } + // { // DEBUG + // if (buckets[getBucket(node)][getIndex(node)].value != value) { + // std::cout << "ERROR ! Trying to remove " << value; + // std::cout << " but found " << buckets[getBucket(node)][getIndex(node)].value; + // std::cout << std::endl; + // } + // } if (node == lastNode) { // On a supprimé le dernier noeud. --lastNode;