nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.25k stars 320 forks source link

Make a couple of things 'const' #1289

Closed ac000 closed 1 month ago

ac000 commented 1 month ago

Just as the commit subject says, this constifies the str parameter to nxt_tstr_compile()

I have some code like

    static nxt_str_t        accept_enc_str =                                    
                                    nxt_string("$header_accept_encoding");      
    static const nxt_str_t  comps_str = nxt_string("compressors");              
    static const nxt_str_t  mimes_str = nxt_string("types");

Looking at it, you may wonder why the first one isn't static const, well it can be after this patch...

filesystem_str can be defined as static const rather than just static