Re: Remove unused variable from SharedSort

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Remove unused variable from SharedSort
Дата
Msg-id CALj2ACXwVk57c3+sMjVQNcRuENO2dKA-P_EVLvzWiZg1X7RgNA@mail.gmail.com
обсуждение исходный текст
Ответ на Remove unused variable from SharedSort  (Dilip Kumar <dilipbalaut@gmail.com>)
Ответы Re: Remove unused variable from SharedSort
Список pgsql-hackers
On Thu, Nov 12, 2020 at 5:29 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> While going through the code I noticed that the nTapes member in
> SharedSort is unused.  This is just initialized with nworkers but
> never used.  The attached patch removes this variable.
>

We could have used that variable for an assert like
Assert(state->worker <= shared->nTapes) in worker_freeze_result_tape()
before accessing shared->tapes[state->worker] = output; as sometimes
state->worker is being set to -1. But, it seems like we reach
worker_freeze_result_tape(), only when  WORKER(state) is true. So, we
don't need that extra Assert and removing nTapes variable makes sense
to me.

Patch looks good to me. Regression tests make check and make
check-world ran successfully.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Supporting = operator in gin/gist_trgm_ops
Следующее
От: Li Japin
Дата:
Сообщение: Re: Terminate the idle sessions