From 4dc2a9e95d115547b7c2680f198293d6e25658b3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 2 Aug 2009 13:51:20 -0700 Subject: http: find_common_field_value => find_common_field The "_value" suffix was used to denote the return type, which is redundandant as it is already known at compile time (being that this is C and functions have explicit return types). Furthurmore, the "_value" is confusing since we're actually returning a "key" when "value" is used in the context of "key-value" pairs. --- ext/unicorn_http/common_field_optimization.h | 2 +- ext/unicorn_http/unicorn_http.rl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/unicorn_http/common_field_optimization.h b/ext/unicorn_http/common_field_optimization.h index 978f0d7..adebe2c 100644 --- a/ext/unicorn_http/common_field_optimization.h +++ b/ext/unicorn_http/common_field_optimization.h @@ -81,7 +81,7 @@ static void init_common_fields(void) } /* this function is called for every header set */ -static VALUE find_common_field_value(const char *field, size_t flen) +static VALUE find_common_field(const char *field, size_t flen) { int i; struct common_field *cf = common_http_fields; diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index 86ef46e..706c77c 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -148,7 +148,7 @@ static void http_field(VALUE req, const char *field, VALIDATE_MAX_LENGTH(flen, FIELD_NAME); VALIDATE_MAX_LENGTH(vlen, FIELD_VALUE); - f = find_common_field_value(field, flen); + f = find_common_field(field, flen); if (f == Qnil) { /* @@ -386,6 +386,6 @@ void Init_unicorn_http(void) rb_define_method(cHttpParser, "execute", HttpParser_execute,2); sym_http_body = ID2SYM(rb_intern("http_body")); init_common_fields(); - g_http_host = find_common_field_value("HOST", 4); + g_http_host = find_common_field("HOST", 4); assert(g_http_host != Qnil); } -- cgit v1.2.3-24-ge0c7