Commit 6c00d2c
committed
Tidy up join_search_one_level code
The code in join_search_one_level was a bit convoluted. With a casual
glance, you might think that other_rels_list was being set to something
other than joinrels[1] when level == 2, however, joinrels[level - 1] is
joinrels[1] when level == 2, so nothing special needs to happen to set
other_rels_list. Let's clean that up to avoid confusing anyone.
In passing, we may as well modernize the loop in
make_rels_by_clause_joins() and instead of passing in the ListCell to
start looping from, let's just pass in the index where to start from and
make use of for_each_from(). Ever since 1cff1b9, Lists are arrays
under the hood. lnext() and list_head() both seem a little too linked-list
like.
Author: Alex Hsieh, David Rowley, Richard Guo
Reviewed-by: Julien Rouhaud
Discussion: https://postgr.es/m/CANWNU8x9P9aCXGF%3DaT-A_8mLTAT0LkcZ_ySYrGbcuHzMQw2-1g%40mail.gmail.com1 parent 81ccbe5 commit 6c00d2c
1 file changed
+18
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 111 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
122 | 115 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 116 | + | |
127 | 117 | | |
128 | 118 | | |
129 | 119 | | |
| |||
167 | 157 | | |
168 | 158 | | |
169 | 159 | | |
170 | | - | |
171 | | - | |
| 160 | + | |
172 | 161 | | |
173 | 162 | | |
174 | 163 | | |
| |||
180 | 169 | | |
181 | 170 | | |
182 | 171 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 172 | + | |
| 173 | + | |
189 | 174 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 175 | + | |
194 | 176 | | |
195 | | - | |
| 177 | + | |
196 | 178 | | |
197 | 179 | | |
198 | 180 | | |
| |||
286 | 268 | | |
287 | 269 | | |
288 | 270 | | |
289 | | - | |
290 | | - | |
291 | | - | |
| 271 | + | |
| 272 | + | |
292 | 273 | | |
293 | 274 | | |
294 | 275 | | |
295 | 276 | | |
296 | 277 | | |
297 | 278 | | |
298 | 279 | | |
299 | | - | |
300 | | - | |
| 280 | + | |
| 281 | + | |
301 | 282 | | |
302 | 283 | | |
303 | 284 | | |
304 | | - | |
| 285 | + | |
305 | 286 | | |
306 | 287 | | |
307 | 288 | | |
| |||
0 commit comments