From eb6e9e5bac6ced303de5f9f8b103ef3fa31fde7c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 5 Mar 2017 02:55:21 +0000 Subject: update comment about freezing values Comments require maintenance along with code :P --- ext/kcar/kcar.rl | 4 ++-- 1 file 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 -- cgit v1.2.3-24-ge0c7