- Notifications
You must be signed in to change notification settings - Fork28
Commitbe182d5
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 parentc0a493e commitbe182d5
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
| 109 | + | |
109 | 110 |
| |
110 | 111 |
| |
111 | 112 |
| |
112 | 113 |
| |
| 114 | + | |
113 | 115 |
| |
114 | 116 |
| |
115 | 117 |
| |
116 | 118 |
| |
| 119 | + | |
117 | 120 |
| |
118 | 121 |
| |
119 | 122 |
| |
120 | 123 |
| |
| 124 | + | |
121 | 125 |
| |
122 | 126 |
| |
123 | 127 |
| |
124 | 128 |
| |
| 129 | + | |
125 | 130 |
| |
126 | 131 |
| |
127 | 132 |
| |
128 | 133 |
| |
| 134 | + | |
129 | 135 |
| |
130 | 136 |
| |
131 | 137 |
| |
| |||
204 | 210 |
| |
205 | 211 |
| |
206 | 212 |
| |
| 213 | + | |
207 | 214 |
| |
208 | 215 |
| |
209 | 216 |
| |
|
0 commit comments
Comments
(0)