diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2025-05-19 21:17:49 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2025-05-19 21:17:49 +0200 |
commit | b2d8dcd8673cfcdbf1e8a02aa19c53e42b8a60b6 (patch) | |
tree | 7de178aec8ebeacc7b4effe3b09de4485487da65 /hashtable.sml | |
parent | 88378509521b46e615986f8c82d10b9da88830d2 (diff) |
Transition from exception-based errors to printf-based
Diffstat (limited to 'hashtable.sml')
-rw-r--r-- | hashtable.sml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hashtable.sml b/hashtable.sml index 6ec7277..822d1fd 100644 --- a/hashtable.sml +++ b/hashtable.sml @@ -39,12 +39,12 @@ structure Hashtable: HASHTABLE = struct fun next idx mask = (idx + `1) andb mask - fun lookup2 ((array, _, mask): 'a t) (key: string) f g = + fun lookup2 (array, _, mask) key f g = let fun find idx = case sub (array, !idx) of NONE => g () - | SOME (key', v: 'a) => + | SOME (key', v) => if key' = key then case f v of (NONE, res) => res |