aboutsummaryrefslogtreecommitdiff
path: root/frontend/containers.icl
diff options
context:
space:
mode:
authorjohnvg2011-04-19 11:37:59 +0000
committerjohnvg2011-04-19 11:37:59 +0000
commitd0ae22e4b794606ef99dc124b8b40a93cc24f9ba (patch)
treee880d814aef67ca23e44808a4b30f054606dbc13 /frontend/containers.icl
parentadd instance declarations with a qualified class name (diff)
use unique array select and update instead of replace
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1930 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/containers.icl')
-rw-r--r--frontend/containers.icl18
1 files changed, 6 insertions, 12 deletions
diff --git a/frontend/containers.icl b/frontend/containers.icl
index 6b1cd08..2b2bd8b 100644
--- a/frontend/containers.icl
+++ b/frontend/containers.icl
@@ -387,14 +387,11 @@ ikhInsert :: !Bool !IntKey a !*(IntKeyHashtable a) -> (!Bool, !.IntKeyHashtable
ikhInsert overide int_key value (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries)
| ikh_rehash_threshold<=ikh_nr_of_entries
= ikhInsert overide int_key value (grow ikh_entries)
- #! hash_value
- = int_key bitand ikh_bitmask
- (tree, ikh_entries)
- = replace ikh_entries hash_value IKT_Leaf
+ #! hash_value = int_key bitand ikh_bitmask
+ (tree, ikh_entries) = ikh_entries![hash_value]
(is_new, tree)
= iktUInsert overide int_key value tree
- ikh_entries
- = { ikh_entries & [hash_value] = tree }
+ ikh_entries = { ikh_entries & [hash_value] = tree }
| is_new
= (is_new, (IntKeyHashtable ikh_rehash_threshold (ikh_nr_of_entries+1) ikh_bitmask ikh_entries))
= (is_new, (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries))
@@ -444,14 +441,11 @@ ikhUSearch :: !IntKey !*(IntKeyHashtable a) -> (!.Optional a, !*IntKeyHashtable
ikhUSearch int_key (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries)
| size ikh_entries==0
= (No, IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries)
- # hash_value
- = int_key bitand ikh_bitmask
- (ikt, ikh_entries)
- = replace ikh_entries hash_value IKT_Leaf
+ # hash_value = int_key bitand ikh_bitmask
+ (ikt, ikh_entries) = ikh_entries![hash_value]
(opt_result, ikt)
= iktUSearch int_key ikt
- ikh_entries
- = { ikh_entries & [hash_value] = ikt }
+ ikh_entries = { ikh_entries & [hash_value] = ikt }
= (opt_result, (IntKeyHashtable ikh_rehash_threshold ikh_nr_of_entries ikh_bitmask ikh_entries))
iktUInsert :: !Bool !IntKey a !*(IntKeyTree a) -> (!Bool, !.IntKeyTree a)