"index off;" directive?

Fabiano Furtado fabianofurtado at gmail.com
Wed May 13 15:37:50 UTC 2026


Hello!

On Wed, May 13, 2026 at 11:05 AM Maxim Dounin wrote:
>
> Hello!
> [...]
> > Thank you for accepting my idea and developing the patch! This is my
> > first contribution to open-source software! :)
>
> Congratulations! :)
>
> > Yet, I have one doubt, specifically at the end of the function
> > ngx_http_index_merge_loc_conf().
> >
> > [...]
> Certainly the first return is not needed here, at least with the
> existing code.  No coding style rules require two returns here,
> but they still can appear for various reasons - for example, when
> two distinct returns are better from readability point of view,
> notably when some additional code might appear after the "if" block
> and this code is not expected to be executed when "if" matches.
>
> My best guess is that it is a leftover from the previously used
> code structure, where there was some proof-of-concept additional
> code after the "no indices defined" if block (and this code wasn't
> expected to be executed without user-defined indices):
>
> https://freenginx.org/hg/nginx/rev/9b8c906f6e63#l63.677
>
> Still, it might be intentionally left this way (e.g., assuming
> that some code for user-defined indices will be added later).

OK. Thank you!


More information about the nginx-devel mailing list