lib: remove warnings on hash_debug, more_collections, ordered_tree, and poset
authorJean Privat <jean@pryen.org>
Wed, 26 Nov 2014 03:41:38 +0000 (22:41 -0500)
committerJean Privat <jean@pryen.org>
Thu, 27 Nov 2014 15:44:22 +0000 (10:44 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/hash_debug.nit
lib/more_collections.nit
lib/ordered_tree.nit
lib/poset.nit

index 8426097..1626437 100644 (file)
@@ -136,7 +136,7 @@ redef class HashCollection[K]
        # Count and update length of collisions for `node_at_idx`
        # Note for dynamic call-graph analysis: callers of this functions are
        # responsible of collisions.
-       private fun gt_collide(i: Int, k: K)
+       fun gt_collide(i: Int, k: K)
        do
                var c = _array[i]
                sys.gt_coll += 1
@@ -159,7 +159,7 @@ redef class HashCollection[K]
        # Count and update length of collisions for `store`
        # Note for dynamic call-graph analysis: callers of this functions are
        # responsible of collisions.
-       private fun st_collide(i: Int, n: N)
+       fun st_collide(i: Int, n: N)
        do
                var c = _array[i]
                sys.st_coll += 1
index bd441a1..9d54445 100644 (file)
@@ -48,13 +48,11 @@ class MultiHashMap[K: Object, V]
                self[key] = res
                return res
        end
-
-       init do end
 end
 
 # Simple way to store an `HashMap[K1, HashMap[K2, V]]`
 class HashMap2[K1: Object, K2: Object, V]
-       private var level1: HashMap[K1, HashMap[K2, V]] = new HashMap[K1, HashMap[K2, V]]
+       private var level1 = new HashMap[K1, HashMap[K2, V]]
 
        # Return the value associated to the keys `k1` and `k2`.
        # Return `null` if no such a value.
@@ -84,7 +82,7 @@ end
 
 # Simple way to store an `HashMap[K1, HashMap[K2, HashMap[K3, V]]]`
 class HashMap3[K1: Object, K2: Object, K3: Object, V]
-       private var level1: HashMap[K1, HashMap2[K2, K3, V]] = new HashMap[K1, HashMap2[K2, K3, V]]
+       private var level1 = new HashMap[K1, HashMap2[K2, K3, V]]
 
        # Return the value associated to the keys `k1`, `k2`, and `k3`.
        # Return `null` if no such a value.
index 34ca522..d64df28 100644 (file)
@@ -54,7 +54,6 @@ class OrderedTree[E: Object]
        # Write a ASCII-style tree and use the `display` method to label elements
        redef fun write_to(stream: OStream)
        do
-               var last = roots.last
                for r in roots do
                        stream.write display(r)
                        stream.write "\n"
index 9549e48..6117ce5 100644 (file)
@@ -31,7 +31,7 @@ class POSet[E: Object]
        redef fun iterator do return elements.keys.iterator
 
        # All the nodes
-       private var elements: HashMap[E, POSetElement[E]] = new HashMap[E, POSetElement[E]]
+       private var elements = new HashMap[E, POSetElement[E]]
 
        redef fun has(e) do return self.elements.keys.has(e)