Commits

Kelvin Jin committed 5fac31c

fixed iter. should be functional now.

  • Participants
  • Parent commits ca1d858

Comments (0)

Files changed (1)

File shared/hashtable.ml

   let size = Array.length hash_table in
   for index = 0 to size - 1 do
     let current_list = Array.get hash_table index in
-    let helper lst (k, v) = (f k v)::lst in
-    let new_reversed_list = List.fold_left helper [] current_list in
-    let new_list = List.rev new_reversed_list in
-    Array.set hash_table index new_list
+    let helper lst (k, v) = f k v in
+    List.fold_left helper () current_list
   done
 
 let fold f table init =