use newer API of xhash

This commit is contained in:
Yuichi Nishiwaki 2014-02-01 20:01:26 +09:00
parent 208fa63699
commit c5c3f4c1f5
2 changed files with 2 additions and 4 deletions

View File

@ -146,7 +146,7 @@ new_analyze_state(pic_state *pic)
push_scope(state, pic_nil_value());
global_tbl = pic->global_tbl;
for (it = xh_begin(global_tbl); ! xh_isend(&it); xh_next(global_tbl, &it)) {
for (xh_begin(global_tbl, &it); ! xh_isend(&it); xh_next(&it)) {
xh_put(state->scope->var_tbl, it.e->key, 0);
}

View File

@ -186,8 +186,7 @@ pic_import(pic_state *pic, pic_value spec)
if (! lib) {
pic_error(pic, "library not found");
}
it = xh_begin(lib->exports);
while (! xh_isend(&it)) {
for (xh_begin(lib->exports, &it); ! xh_isend(&it); xh_next(&it)) {
#if DEBUG
if (it.e->val >= 0) {
printf("* importing %s as %s\n", it.e->key, pic_symbol_name(pic, (pic_sym)it.e->val));
@ -212,7 +211,6 @@ pic_import(pic_state *pic, pic_value spec)
xh_put(senv->tbl, it.e->key, ~idx);
senv->xlen++;
}
xh_next(lib->exports, &it);
}
}