about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-08-02 13:51:20 -0700
committerEric Wong <normalperson@yhbt.net>2009-08-09 01:24:46 -0700
commit4dc2a9e95d115547b7c2680f198293d6e25658b3 (patch)
treec61a7c69368e52ecc81efe87d35409ab1fb9931e
parentca3fd8acb4bc3f5125a9f0f281951fb8f03778e5 (diff)
downloadunicorn-4dc2a9e95d115547b7c2680f198293d6e25658b3.tar.gz
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.
-rw-r--r--ext/unicorn_http/common_field_optimization.h2
-rw-r--r--ext/unicorn_http/unicorn_http.rl4
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);
 }