]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
remove unneeded type casts
authorJuerg Billeter <j@bitron.ch>
Tue, 22 Jan 2008 08:12:10 +0000 (08:12 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 22 Jan 2008 08:12:10 +0000 (08:12 +0000)
2008-01-22  Juerg Billeter  <j@bitron.ch>

* gee/hashmap.vala, gee/hashset.vala: remove unneeded type casts

svn path=/trunk/; revision=879

ChangeLog
gee/hashmap.vala
gee/hashset.vala

index 0d6705f6a4817d0c7bea9c02927e2ad3441b5d7c..a9eb7e5bee6297611b2b653543b580520d6cd179 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-22  Jürg Billeter  <j@bitron.ch>
+
+       * gee/hashmap.vala, gee/hashset.vala: remove unneeded type casts
+
 2008-01-22  Jürg Billeter  <j@bitron.ch>
 
        * gobject/valaccodearraycreationexpressionbinding.vala,
index df20d630bff8326c6b074ced6bfd6c1d2a0d5037..2de53250f7d20bec9b69d22f90736b2d36e6e90d 100644 (file)
@@ -77,8 +77,8 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
        private Node<K,V>** lookup_node (K key) {
                uint hash_value = _key_hash_func (key);
                Node<K,V>** node = &_nodes[hash_value % _array_size];
-               while ((*node) != null && (hash_value != ((Node<K,V>) (*node)).key_hash || !_key_equal_func (((Node<K,V>) (*node)).key, key))) {
-                       node = &(((Node<K,V>) (*node)).next);
+               while ((*node) != null && (hash_value != (*node)->key_hash || !_key_equal_func ((*node)->key, key))) {
+                       node = &((*node)->next);
                }
                return node;
        }
@@ -89,9 +89,9 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
        }
 
        public V get (K key) {
-               weak Node<K,V> node = (Node<K,V>) (*lookup_node (key));
+               Node<K,V>* node = (*lookup_node (key));
                if (node != null) {
-                       return node.value;
+                       return node->value;
                } else {
                        return null;
                }
@@ -100,7 +100,7 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
        public void set (K key, V value) {
                Node<K,V>** node = lookup_node (key);
                if (*node != null) {
-                       ((Node<K,V>) (*node)).value = value;
+                       (*node)->value = value;
                } else {
                        uint hash_value = _key_hash_func (key);
                        *node = new Node<K,V> (key, value, hash_value);
@@ -113,9 +113,9 @@ public class Gee.HashMap<K,V> : Object, Map<K,V> {
        public bool remove (K key) {
                Node<K,V>** node = lookup_node (key);
                if (*node != null) {
-                       ((Node<K,V>) (*node)).key = null;
-                       ((Node<K,V>) (*node)).value = null;
-                       *node = ((Node<K,V>) (*node)).next;
+                       (*node)->key = null;
+                       (*node)->value = null;
+                       *node = (*node)->next;
                        _nnodes--;
                        resize ();
                        _stamp++;
index a01b810037a56f7e18f85eb2925ed12a4c18b351..ad076bd4fa1d882bb4fbead3f74bc9ecf53d4a6c 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
  * Copyright (C) 1997-2000  GLib Team and others
- * Copyright (C) 2007  Jürg Billeter
+ * Copyright (C) 2007-2008  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -64,8 +64,8 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
        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<G>) (*node)).key_hash || !_equal_func (((Node<G>) (*node)).key, key))) {
-                       node = &(((Node<G>) (*node)).next);
+               while ((*node) != null && (hash_value != (*node)->key_hash || !_equal_func ((*node)->key, key))) {
+                       node = &((*node)->next);
                }
                return node;
        }
@@ -96,8 +96,8 @@ public class Gee.HashSet<G> : Object, Iterable<G>, Collection<G>, Set<G> {
        public bool remove (G key) {
                Node<G>** node = lookup_node (key);
                if (*node != null) {
-                       ((Node<G>) (*node)).key = null;
-                       *node = ((Node<G>) (*node)).next;
+                       (*node)->key = null;
+                       *node = (*node)->next;
                        _nnodes--;
                        resize ();
                        _stamp++;