about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-01-06 17:23:13 -0800
committerEric Wong <normalperson@yhbt.net>2010-01-06 17:23:13 -0800
commitab37f2d65b01370ae975346110471f33b10bd178 (patch)
tree5fb44351728130e02b6c2f5cc89218d6fb619aa2 /ext
parentb082327b0363f5236a267abd8a412e18ce9918e0 (diff)
downloadclogger-ab37f2d65b01370ae975346110471f33b10bd178.tar.gz
It's too crazy to have to special case for frozen response
constants.  3-element arrays are cheap under Ruby 1.9 anyways.
Diffstat (limited to 'ext')
-rw-r--r--ext/clogger_ext/clogger.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c
index 26d1ec6..f2d82d6 100644
--- a/ext/clogger_ext/clogger.c
+++ b/ext/clogger_ext/clogger.c
@@ -689,10 +689,9 @@ static VALUE ccall(struct clogger *c, VALUE env)
                 c->headers = tmp[1];
                 c->body = tmp[2];
 
+                rv = rb_ary_new4(3, tmp);
                 if (c->need_resp && cHeaderHash != rb_obj_class(c->headers)) {
                         c->headers = rb_funcall(cHeaderHash, new_id, 1, tmp[1]);
-                        if (OBJ_FROZEN(rv))
-                                rv = rb_ary_dup(rv);
                         rb_ary_store(rv, 1, c->headers);
                 }
         } else {
@@ -732,8 +731,7 @@ static VALUE clogger_call(VALUE self, VALUE env)
                 }
 
                 rv = ccall(c, env);
-                if (OBJ_FROZEN(rv))
-                        rv = rb_ary_dup(rv);
+                assert(!OBJ_FROZEN(rv) && "frozen response array");
                 rb_ary_store(rv, 2, self);
 
                 return rv;