Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/smlnj-lib/Util/int-hash-table.sml
ViewVC logotype

Diff of /sml/trunk/src/smlnj-lib/Util/int-hash-table.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 815, Fri May 4 05:09:10 2001 UTC revision 816, Fri May 4 16:37:36 2001 UTC
# Line 70  Line 70 
70              (* end case *)              (* end case *)
71            end            end
72    
73      (* return true, if the key is in the domain of the table *)
74        fun inDomain (HT{table, ...}) key = let
75              val arr = !table
76              val hash = hashVal key
77              val indx = index (hash, Array.length arr)
78              fun look HTRep.NIL = false
79                | look (HTRep.B(h, k, v, r)) =
80                    ((hash = h) andalso sameKey(key, k)) orelse look r
81              in
82                look (Array.sub (arr, indx))
83              end
84    
85    (* find an item, the table's exception is raised if the item doesn't exist *)    (* find an item, the table's exception is raised if the item doesn't exist *)
86      fun lookup (HT{table, not_found, ...}) key = let      fun lookup (HT{table, not_found, ...}) key = let
87            val arr = !table            val arr = !table

Legend:
Removed from v.815  
changed lines
  Added in v.816

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0