Commit 3e9caf5
authored
uri: Optimize
* uri: Do not check the return value of `uri_property_handler_from_internal_uri()`
It's impossible for this function to return `NULL`, since it will always return
a positive offset into a struct.
* uri: Optimize `php_uri_get_*()`
Currently the `php_uri_get_*()` functions call into `php_uri_get_property()`
with a constant `php_uri_property_name`. This name will then be used to look up
the correct property handler by a function in a different compilation unit.
Improve this by making `uri_property_handler_from_internal_uri` take a
`php_uri_parser` rather than a `uri_internal_t`, defining it in a header as
inlinable (and renaming it to better match its updated purpose).
This allows the compiler to fully inline `php_uri_get_property()`, such that no
dynamic lookups will need to happen.
* uri: Eliminate `php_uri_get_property()` entirely
Spelling out the effective implementation explicitly is not much longer than
going through `php_uri_get_property()`, but much more explicit in what is
happening.php_uri_get_*() (#19807)1 parent bd4e2c7 commit 3e9caf5
3 files changed
+33
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 127 | | |
138 | 128 | | |
139 | | - | |
| 129 | + | |
140 | 130 | | |
141 | 131 | | |
142 | 132 | | |
143 | 133 | | |
144 | | - | |
| 134 | + | |
145 | 135 | | |
146 | 136 | | |
147 | 137 | | |
148 | 138 | | |
149 | | - | |
| 139 | + | |
150 | 140 | | |
151 | 141 | | |
152 | 142 | | |
153 | 143 | | |
154 | | - | |
| 144 | + | |
155 | 145 | | |
156 | 146 | | |
157 | 147 | | |
158 | 148 | | |
159 | | - | |
| 149 | + | |
160 | 150 | | |
161 | 151 | | |
162 | 152 | | |
163 | 153 | | |
164 | | - | |
| 154 | + | |
165 | 155 | | |
166 | 156 | | |
167 | 157 | | |
168 | 158 | | |
169 | | - | |
| 159 | + | |
170 | 160 | | |
171 | 161 | | |
172 | 162 | | |
173 | 163 | | |
174 | | - | |
| 164 | + | |
175 | 165 | | |
176 | 166 | | |
177 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 22 | | |
46 | 23 | | |
47 | 24 | | |
| |||
72 | 49 | | |
73 | 50 | | |
74 | 51 | | |
75 | | - | |
76 | | - | |
| 52 | + | |
77 | 53 | | |
78 | 54 | | |
79 | 55 | | |
| |||
96 | 72 | | |
97 | 73 | | |
98 | 74 | | |
99 | | - | |
100 | | - | |
| 75 | + | |
101 | 76 | | |
102 | 77 | | |
103 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
170 | 192 | | |
171 | 193 | | |
172 | 194 | | |
| |||
0 commit comments