summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-07 01:52:55 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-07 01:52:55 -0800
commitde19a8fec7353f9e81a3c4660dd314d5cd15fd02 (patch)
tree7a1b854171f8938da35a2f478df2c9d96820ed4a
parent8f1e28d8625c561b91e39757e452ca6fa221fd59 (diff)
downloadmc-de19a8fec7353f9e81a3c4660dd314d5cd15fd02.tar.gz
Use std.htbykeyvals in inifile.
-rw-r--r--lib/inifile/parse.myr8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/inifile/parse.myr b/lib/inifile/parse.myr
index 33b5bae..39b2722 100644
--- a/lib/inifile/parse.myr
+++ b/lib/inifile/parse.myr
@@ -25,15 +25,11 @@ const load = {path
}
const free = {ini
- var kl
-
- kl = std.htkeys(ini.elts)
- for (sect, key) in kl
- std.slfree(std.htgetv(ini.elts, (sect, key), ""))
+ for ((sect, key), val) in std.htbykeyvals(ini.elts)
+ std.slfree(val)
std.slfree(sect)
std.slfree(key)
;;
- std.slfree(kl)
std.htfree(ini.elts)
std.free(ini)
}