about summary refs log tree commit diff stats
path: root/070table.mu
diff options
context:
space:
mode:
Diffstat (limited to '070table.mu')
-rw-r--r--070table.mu14
1 files changed, 7 insertions, 7 deletions
diff --git a/070table.mu b/070table.mu
index 111e56b5..1b3d5fd3 100644
--- a/070table.mu
+++ b/070table.mu
@@ -51,15 +51,15 @@ def put-index table:&:table:_key:_value, key:_key, value:_value -> table:&:table
   hash:num <- hash key
   hash <- abs hash
   capacity:num <- get *table, capacity:offset
-  _, hash <- divide-with-remainder hash, capacity
-  hash <- abs hash  # in case hash overflows into a negative integer
+  _, hash-key:num <- divide-with-remainder hash, capacity
+  hash-key <- abs hash-key  # in case hash-key overflows into a negative integer
   table-data:&:@:table-row:_key:_value <- get *table, data:offset
-  x:table-row:_key:_value <- index *table-data, hash
+  x:table-row:_key:_value <- index *table-data, hash-key
   occupied?:bool <- get x, occupied?:offset
   not-occupied?:bool <- not occupied?:bool
   assert not-occupied?, [can't handle collisions yet]
   new-row:table-row:_key:_value <- merge 1/true, key, value
-  *table-data <- put-index *table-data, hash, new-row
+  *table-data <- put-index *table-data, hash-key, new-row
 ]
 
 def abs n:num -> result:num [
@@ -76,10 +76,10 @@ def index table:&:table:_key:_value, key:_key -> result:_value [
   hash:num <- hash key
   hash <- abs hash
   capacity:num <- get *table, capacity:offset
-  _, hash <- divide-with-remainder hash, capacity
-  hash <- abs hash  # in case hash overflows into a negative integer
+  _, hash-key:num <- divide-with-remainder hash, capacity
+  hash-key <- abs hash-key  # in case hash-key overflows into a negative integer
   table-data:&:@:table-row:_key:_value <- get *table, data:offset
-  x:table-row:_key:_value <- index *table-data, hash
+  x:table-row:_key:_value <- index *table-data, hash-key
   occupied?:bool <- get x, occupied?:offset
   assert occupied?, [can't handle missing elements yet]
   result <- get x, value:offset
8' href='#n148'>148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207