Re: Improve join_search_one_level readibilty (one line change)
От | Julien Rouhaud |
---|---|
Тема | Re: Improve join_search_one_level readibilty (one line change) |
Дата | |
Msg-id | 20230731134837.dpugorvuhtv27b3t@jrouhaud обсуждение исходный текст |
Ответ на | Re: Improve join_search_one_level readibilty (one line change) (謝東霖 <douenergy@gmail.com>) |
Ответы |
Re: Improve join_search_one_level readibilty (one line change)
|
Список | pgsql-hackers |
Hi, On Wed, Jun 07, 2023 at 11:02:09AM +0800, 謝東霖 wrote: > Thank you, Julien, for letting me know that cfbot doesn't test txt files. > Much appreciated! Thanks for posting this v2! So unsurprisingly the cfbot is happy with this patch, since it doesn't change the behavior at all. I just have some nitpicking: @@ -109,14 +109,14 @@ join_search_one_level(PlannerInfo *root, int level) List *other_rels_list; ListCell *other_rels; + other_rels_list = joinrels[1]; + if (level == 2) /* consider remaining initial rels */ { - other_rels_list = joinrels[level - 1]; other_rels = lnext(other_rels_list, r); } else /* consider all initial rels */ { - other_rels_list = joinrels[1]; other_rels = list_head(other_rels_list); } Since each branch only has a single instruction after the change the curly braces aren't needed anymore. The only reason keep them is if it helps readability (like if there's a big comment associated), but that's not the case here so it would be better to get rid of them. Apart from that +1 from me for the patch, I think it helps focusing the attention on what actually matters here.
В списке pgsql-hackers по дате отправления: