瀏覽代碼

Tweak the nil encoding logic

I must've managed to miss the PR update from Stanislav the other day
when merging this.
pull/72/head
Paul J. Davis 10 年之前
父節點
當前提交
5eb499d73e
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. +6
    -2
      c_src/encoder.c

+ 6
- 2
c_src/encoder.c 查看文件

@ -713,11 +713,15 @@ encode_iter(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
stack = enif_make_list_cell(env, e->atoms->ref_array, stack);
stack = enif_make_list_cell(env, item, stack);
} else if(enif_compare(curr, e->atoms->atom_null) == 0
|| (e->use_nil && enif_compare(curr, e->atoms->atom_nil) == 0)) {
if(!enc_literal(e, "null", 4)) {
ret = enc_error(e, "null");
goto done;
}
}
} else if(e->use_nil && enif_compare(curr, e->atoms->atom_nil) == 0)) {
if(!enc_literal(e, "null", 4)) {
ret = enc_error(e, "null");
goto done;
}
} else if(enif_compare(curr, e->atoms->atom_true) == 0) {
if(!enc_literal(e, "true", 4)) {
ret = enc_error(e, "true");

Loading…
取消
儲存