constness of key in ngx_hash_find_

Igor Sysoev is at rambler-co.ru
Mon Oct 20 12:22:52 MSD 2008


On Sun, Oct 19, 2008 at 12:13:05AM +0530, Arvind Jayaprakash wrote:

> I was wondering if the "name" argument and also "hash" in the following
> functions should be const
> 
> void *ngx_hash_find(ngx_hash_t *hash, ngx_uint_t key, u_char *name,
> size_t len);
> void *ngx_hash_find_wc_head(ngx_hash_wildcard_t *hwc, u_char *name,
> size_t len);
> void *ngx_hash_find_wc_tail(ngx_hash_wildcard_t *hwc, u_char *name,
> size_t len);
> void *ngx_hash_find_combined(ngx_hash_combined_t *hash, ngx_uint_t key,
>     u_char *name, size_t len);
> 
> 
> If that happens, then I can ask for similar changes in
> ngx_http_variables{c,h}  :-)

Do you mean

-void *ngx_hash_find(ngx_hash_t *hash, ..., u_char *name,
+void *ngx_hash_find(const ngx_hash_t *hash, ..., const u_char *name,

?

But what will this improve ?


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list