forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitff93980
committed
Improve castNode notation by introducing list-extraction-specific variants.
This extends the castNode() notation introduced by commit5bcab11 toprovide, in one step, extraction of a list cell's pointer and coercion toa concrete node type. For example, "lfirst_node(Foo, lc)" is the sameas "castNode(Foo, lfirst(lc))". Almost half of the uses of castNodethat have appeared so far include a list extraction call, so this ispretty widely useful, and it saves a few more keystrokes compared to theold way.As with the previous patch, back-patch the addition of these macros topg_list.h, so that the notation will be available when back-patching.Patch by me, after an idea of Andrew Gierth's.Discussion:https://postgr.es/m/14197.1491841216@sss.pgh.pa.us1 parent649cd90 commitff93980
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| 133 | + | |
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| 143 | + | |
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
| |||
209 | 215 | | |
210 | 216 | | |
211 | 217 | | |
| 218 | + | |
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
| |||
0 commit comments
Comments
(0)