diff options
-rw-r--r-- | ext/kcar/kcar.rl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/kcar/kcar.rl b/ext/kcar/kcar.rl index cbffb7e..ef3e393 100644 --- a/ext/kcar/kcar.rl +++ b/ext/kcar/kcar.rl @@ -100,6 +100,8 @@ static VALUE str_dd_freeze(VALUE str) { if (STR_UMINUS_DEDUPE) return rb_funcall(str, id_uminus, 0); + + /* freeze,since it speeds up MRI slightly */ OBJ_FREEZE(str); return str; } @@ -294,8 +296,6 @@ static void write_value(VALUE hdr, struct http_parser *hp, e = rb_funcall(hdr, id_sq, 1, f); if (NIL_P(e)) { - /* new value, freeze it since it speeds up MRI slightly */ - if (hclass == rb_cHash) rb_hash_aset(hdr, f, v); else |