From: Jean Privat Date: Wed, 26 Nov 2014 03:41:38 +0000 (-0500) Subject: lib: remove warnings on hash_debug, more_collections, ordered_tree, and poset X-Git-Tag: v0.6.11~9^2~4 X-Git-Url: http://nitlanguage.org lib: remove warnings on hash_debug, more_collections, ordered_tree, and poset Signed-off-by: Jean Privat --- diff --git a/lib/hash_debug.nit b/lib/hash_debug.nit index 8426097..1626437 100644 --- a/lib/hash_debug.nit +++ b/lib/hash_debug.nit @@ -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 diff --git a/lib/more_collections.nit b/lib/more_collections.nit index bd441a1..9d54445 100644 --- a/lib/more_collections.nit +++ b/lib/more_collections.nit @@ -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. diff --git a/lib/ordered_tree.nit b/lib/ordered_tree.nit index 34ca522..d64df28 100644 --- a/lib/ordered_tree.nit +++ b/lib/ordered_tree.nit @@ -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" diff --git a/lib/poset.nit b/lib/poset.nit index 9549e48..6117ce5 100644 --- a/lib/poset.nit +++ b/lib/poset.nit @@ -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)