Initialize 'next' variables
authorDidier 'Ptitjes <ptitjes@free.fr>
Thu, 16 Jul 2009 08:53:46 +0000 (10:53 +0200)
committerJürg Billeter <j@bitron.ch>
Thu, 16 Jul 2009 09:00:15 +0000 (11:00 +0200)
Fixes bug 588758.

Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>
gee/hashmap.vala
gee/hashset.vala

index 9fa09d3..c69eac6 100644 (file)
@@ -156,7 +156,7 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
 
                        for (int i = 0; i < _array_size; i++) {
                                Node<K,V> node;
-                               Node<K,V> next;
+                               Node<K,V> next = null;
                                for (node = (owned) _nodes[i]; node != null; node = (owned) next) {
                                        next = (owned) node.next;
                                        uint hash_val = node.key_hash % new_array_size;
index d0d0226..ca1dae6 100644 (file)
@@ -140,7 +140,7 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
 
                        for (int i = 0; i < _array_size; i++) {
                                Node<G> node;
-                               Node<G> next;
+                               Node<G> next = null;
                                for (node = (owned) _nodes[i]; node != null; node = (owned) next) {
                                        next = (owned) node.next;
                                        uint hash_val = node.key_hash % new_array_size;