refactor list_by_array

This commit is contained in:
Yuichi Nishiwaki 2014-02-02 21:16:45 +09:00
parent b66021c042
commit 9b31e5bd2f
1 changed files with 3 additions and 4 deletions

View File

@ -83,13 +83,12 @@ pic_value
pic_list_by_array(pic_state *pic, size_t c, pic_value *vs) pic_list_by_array(pic_state *pic, size_t c, pic_value *vs)
{ {
pic_value v; pic_value v;
size_t i;
v = pic_nil_value(); v = pic_nil_value();
for (i = 0; i < c; ++i) { while (c--) {
v = pic_cons(pic, vs[i], v); v = pic_cons(pic, vs[c], v);
} }
return pic_reverse(pic, v); return v;
} }
pic_value pic_value