From b970563fe3f36853250f4cef65a8425431789e8b Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 29 Sep 2010 17:22:07 -0700 Subject: Patchwork of attempted fixes to effect system and gc system; eventually give up and disable it entirely in the runtime. Will need extensive reworking. --- src/lib/map.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/lib') diff --git a/src/lib/map.rs b/src/lib/map.rs index 9ebfd4b6..cdc2d025 100644 --- a/src/lib/map.rs +++ b/src/lib/map.rs @@ -12,15 +12,15 @@ import std._vec; type hashfn[K] = fn(&K) -> uint; type eqfn[K] = fn(&K, &K) -> bool; -type hashmap[K, V] = obj { - fn size() -> uint; - fn insert(&K key, &V val) -> bool; - fn contains_key(&K key) -> bool; - fn get(&K key) -> V; - fn find(&K key) -> util.option[V]; - fn remove(&K key) -> util.option[V]; - fn rehash(); - iter items() -> tup(K,V); +state type hashmap[K, V] = state obj { + fn size() -> uint; + fn insert(&K key, &V val) -> bool; + fn contains_key(&K key) -> bool; + fn get(&K key) -> V; + fn find(&K key) -> util.option[V]; + fn remove(&K key) -> util.option[V]; + fn rehash(); + iter items() -> tup(K,V); }; fn mk_hashmap[K, V](&hashfn[K] hasher, &eqfn[K] eqer) -> hashmap[K, V] { @@ -141,12 +141,12 @@ fn mk_hashmap[K, V](&hashfn[K] hasher, &eqfn[K] eqer) -> hashmap[K, V] { } } - obj hashmap[K, V](hashfn[K] hasher, - eqfn[K] eqer, - mutable vec[mutable bucket[K, V]] bkts, - mutable uint nbkts, - mutable uint nelts, - util.rational lf) + state obj hashmap[K, V](hashfn[K] hasher, + eqfn[K] eqer, + mutable vec[mutable bucket[K, V]] bkts, + mutable uint nbkts, + mutable uint nelts, + util.rational lf) { fn size() -> uint { ret nelts; } -- cgit v1.2.3