From cda1f3381096cdb8c78a126a4993e458bf798ca2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 5 Feb 2009 14:30:29 -0800 Subject: pre-generate HTTP_STATUS_HEADER to avoid repeated snprintf Regenerating headers constantly is a waste of time. --- lib/unicorn/http_response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/unicorn/http_response.rb') diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index c3094cf..7454516 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -87,7 +87,7 @@ module Unicorn def send_status(content_length=@body.length) if not @status_sent @header['Content-Length'] = content_length if content_length and @status != 304 - write(Const::STATUS_FORMAT % [@status, HTTP_STATUS_CODES[@status]]) + write(HTTP_STATUS_HEADERS[@status]) @status_sent = true end end -- cgit v1.2.3-24-ge0c7