Re: Improve join_search_one_level readibilty (one line change)

Поиск
Список
Период
Сортировка
Искать
От
tender wang
Тема
Re: Improve join_search_one_level readibilty (one line change)
Дата
Msg-id
CAHewXNkkZam8ZUFDasFy2yuNPHeByQVF0q=puT0qUe89=4prrg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Improve join_search_one_level readibilty (one line change) 謝東霖 <douenergy@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) Julien Rouhaud <rjuju123@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) Peter Eisentraut <peter@eisentraut.org>
Re: Improve join_search_one_level readibilty (one line change) 謝東霖 <douenergy@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) "Tristan Partin" <tristan@neon.tech>
Re: Improve join_search_one_level readibilty (one line change) tender wang <tndrwang@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) 謝東霖 <douenergy@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) Julien Rouhaud <rjuju123@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) Tom Lane <tgl@sss.pgh.pa.us>
Re: Improve join_search_one_level readibilty (one line change) 謝東霖 <douenergy@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) Julien Rouhaud <rjuju123@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) David Rowley <dgrowleyml@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) Richard Guo <guofenglinux@gmail.com>
Re: Improve join_search_one_level readibilty (one line change) David Rowley <dgrowleyml@gmail.com>


謝東霖 <douenergy@gmail.com> 于2023年6月3日周六 23:21写道:
Hello hackers

Attached is my first patch for PostgreSQL, which is a simple one-liner
that I believe can improve the code.

In the "join_search_one_level" function, I noticed that the variable
"other_rels_list" always refers to "joinrels[1]" even when the (level
== 2) condition is met. I propose changing:

"other_rels_list = joinrels[level - 1]" to "other_rels_list = joinrels[1]"

This modification aims to enhance clarity and avoid unnecessary instructions.
 
I  guess compiler can make that code more efficiency. But from the point of code readibilty, I agree with you.
As Julien Rouhaud said, it had better to  to move the other_rels_list
initialization out of the if instruction and put it with the variable declaration.

I would greatly appreciate any review and feedback on this patch as I
am a newcomer to PostgreSQL contributions. Your input will help me
improve and contribute effectively to the project.

I have followed the excellent guide "How to submit a patch by email,
2023 edition" by Peter Eisentraut.

Additionally, if anyone has any tips on ensuring that Gmail recognizes
my attached patches as the "text/x-patch" MIME type when sending them
from the Chrome client, I would be grateful for the advice.

Or maybe the best practice is to use Git send-email ?

Thank you for your time.

Best regards
Alex Hsieh
В списке pgsql-hackers по дате отправления
От: Thomas Munro
Дата:
От: Zhijie Hou (Fujitsu)
Дата:
FAQ