summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <lvuotto92@gmail.com>2017-11-01 16:53:26 -0300
committerOri Bernstein <ori@markovcorp.com>2017-11-14 13:50:39 -0800
commit83d26331a5419033927800760e8a59f1bd84d2b9 (patch)
treed5985e8e5a32e673f549fcaa8eb23b5335f4f74d /support
parent8a662861ad3ded8e965ab43e5bc254dd7ee85815 (diff)
downloadmc-83d26331a5419033927800760e8a59f1bd84d2b9.tar.gz
Use new traits to implement hash tables
Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Diffstat (limited to 'support')
-rw-r--r--support/dumpleak.myr14
1 files changed, 2 insertions, 12 deletions
diff --git a/support/dumpleak.myr b/support/dumpleak.myr
index dcd6c07..32d8e25 100644
--- a/support/dumpleak.myr
+++ b/support/dumpleak.myr
@@ -38,7 +38,7 @@ const main = {args
;;
;;
- stats.tab = std.mkht(std.inthash, std.inteq)
+ stats.tab = std.mkht()
for d : cmd.args
match bio.open(d, bio.Rd)
| `std.Ok f: dump(d, f, &stats)
@@ -99,7 +99,7 @@ const tracefree = {path, f, stats
const dumptrace = {tab
var aggr
- aggr = std.mkht(hashintsl, std.sleq)
+ aggr = std.mkht()
for (k, (sz, stk)) : std.byhtkeyvals(tab)
match std.htget(aggr, stk[:stackaggr])
| `std.Some (count, total):
@@ -120,13 +120,3 @@ const get64 = {path, f
| res: std.fatal("failed to read {}: {}\n", path, res)
;;
}
-
-const hashintsl = {sl
- var h
-
- h = 0
- for i : sl
- h ^= std.inthash(i)
- ;;
- -> h
-}