diff options
author | Juerg Billeter <j@bitron.ch> | 2007-12-15 11:54:52 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2007-12-15 11:54:52 +0000 |
commit | b261df87989167862fb63387d4b07dfd923e322d (patch) | |
tree | eb65ef38c59b45f83e7de503376564155e89fc3e /gee/hashset.vala | |
parent | 415d9160d8dfd115a5dc747f65aad00cfcf6907b (diff) | |
download | vala-b261df87989167862fb63387d4b07dfd923e322d.tar.gz |
update to be compatible with new pointer types
2007-12-15 Juerg Billeter <j@bitron.ch>
* gee/hashmap.vala, gee/hashset.vala: update to be compatible with new
pointer types
* vala/parser.y, vala/vala.h, vala/valaclass.vala,
vala/valadatatype.vala, vala/valamemorymanager.vala,
vala/valanulltype.vala, vala/valapointertype.vala,
vala/valasemanticanalyzer.vala, vala/valasymbolresolver.vala,
vala/valavoidtype.vala, gobject/valaccodegenerator.vala,
gobject/valaccodegeneratormethod.vala: use PointerType
svn path=/trunk/; revision=774
Diffstat (limited to 'gee/hashset.vala')
-rw-r--r-- | gee/hashset.vala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gee/hashset.vala b/gee/hashset.vala index b901c7f07..a01b81003 100644 --- a/gee/hashset.vala +++ b/gee/hashset.vala @@ -61,17 +61,17 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> { _nodes = new Node<G>[_array_size]; } - private Node<G>* lookup_node (G key) { + private Node<G>** lookup_node (G key) { uint hash_value = _hash_func (key); - Node<G>* node = &_nodes[hash_value % _array_size]; - while ((*node) != null && (hash_value != (*node).key_hash || !_equal_func ((*node).key, key))) { - node = &((*node).next); + Node<G>** node = &_nodes[hash_value % _array_size]; + while ((*node) != null && (hash_value != ((Node<G>) (*node)).key_hash || !_equal_func (((Node<G>) (*node)).key, key))) { + node = &(((Node<G>) (*node)).next); } return node; } public bool contains (G key) { - Node<G>* node = lookup_node (key); + Node<G>** node = lookup_node (key); return (*node != null); } @@ -80,7 +80,7 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> { } public bool add (G key) { - Node<G>* node = lookup_node (key); + Node<G>** node = lookup_node (key); if (*node != null) { return false; } else { @@ -94,10 +94,10 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> { } public bool remove (G key) { - Node<G>* node = lookup_node (key); + Node<G>** node = lookup_node (key); if (*node != null) { - (*node).key = null; - *node = (*node).next; + ((Node<G>) (*node)).key = null; + *node = ((Node<G>) (*node)).next; _nnodes--; resize (); _stamp++; |