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/hash-table-fn.sml
ViewVC logotype

Diff of /sml/trunk/src/smlnj-lib/Util/hash-table-fn.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 65  Line 65 
65              (* end case *)              (* end case *)
66            end            end
67    
68      (* return true, if the key is in the domain of the table *)
69        fun inDomain (HT{table, ...}) key = let
70              val arr = !table
71              val hash = hashVal key
72              val indx = index (hash, Array.length arr)
73              fun look HTRep.NIL = false
74                | look (HTRep.B(h, k, v, r)) =
75                    ((hash = h) andalso sameKey(key, k)) orelse look r
76              in
77                look (Array.sub (arr, indx))
78              end
79    
80    (* 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 *)
81      fun lookup (HT{table, not_found, ...}) key = let      fun lookup (HT{table, not_found, ...}) key = let
82            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