[bugfix] plist<->dictionary broken

This commit is contained in:
Yuichi Nishiwaki 2014-09-15 12:41:51 +09:00
parent 48f0ec9095
commit 5d06801704
1 changed files with 2 additions and 2 deletions

4
dict.c
View File

@ -304,8 +304,8 @@ pic_dict_dictionary_to_plist(pic_state *pic)
xh_begin(&it, &dict->hash);
while (xh_next(&it)) {
pic_push(pic, xh_val(it.e, pic_value), plist);
pic_push(pic, xh_key(it.e, pic_value), plist);
pic_push(pic, xh_val(it.e, pic_value), plist);
}
return pic_reverse(pic, plist);
@ -322,7 +322,7 @@ pic_dict_plist_to_dictionary(pic_state *pic)
dict = pic_make_dict(pic);
for (e = pic_reverse(pic, plist); ! pic_nil_p(e); e = pic_cddr(pic, e)) {
pic_dict_set(pic, dict, pic_car(pic, e), pic_cadr(pic, e));
pic_dict_set(pic, dict, pic_cadr(pic, e), pic_car(pic, e));
}
return pic_obj_value(dict);