Commit 5da0d29
committed
py/vstr: Remove vstr.had_error flag and inline basic vstr functions.
The vstr.had_error flag was a relic from the very early days which assumed
that the malloc functions (eg m_new, m_renew) returned NULL if they failed
to allocate. But that's no longer the case: these functions will raise an
exception if they fail.
Since it was impossible for had_error to be set, this patch introduces no
change in behaviour.
An alternative option would be to change the malloc calls to the _maybe
variants, which return NULL instead of raising, but then a lot of code
will need to explicitly check if the vstr had an error and raise if it
did.
The code-size savings for this patch are, in bytes: bare-arm:188,
minimal:456, unix(NDEBUG,x86-64):368, stmhal:228, esp8266:360.1 parent adaf0d8 commit 5da0d29
3 files changed
Lines changed: 8 additions & 58 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
| 727 | + | |
727 | 728 | | |
728 | 729 | | |
729 | 730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
| |||
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 47 | | |
53 | 48 | | |
54 | 49 | | |
| |||
63 | 58 | | |
64 | 59 | | |
65 | 60 | | |
66 | | - | |
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
| |||
107 | 101 | | |
108 | 102 | | |
109 | 103 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 104 | | |
134 | 105 | | |
135 | 106 | | |
136 | 107 | | |
137 | 108 | | |
138 | 109 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 110 | | |
144 | 111 | | |
145 | 112 | | |
| |||
153 | 120 | | |
154 | 121 | | |
155 | 122 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | 123 | | |
161 | 124 | | |
162 | 125 | | |
163 | 126 | | |
164 | 127 | | |
165 | 128 | | |
166 | 129 | | |
167 | | - | |
168 | | - | |
169 | 130 | | |
170 | | - | |
171 | 131 | | |
172 | 132 | | |
173 | 133 | | |
174 | | - | |
| 134 | + | |
175 | 135 | | |
176 | 136 | | |
177 | 137 | | |
| |||
181 | 141 | | |
182 | 142 | | |
183 | 143 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | 144 | | |
188 | 145 | | |
189 | 146 | | |
| |||
248 | 205 | | |
249 | 206 | | |
250 | 207 | | |
251 | | - | |
| 208 | + | |
252 | 209 | | |
253 | 210 | | |
254 | 211 | | |
| |||
263 | 220 | | |
264 | 221 | | |
265 | 222 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | 223 | | |
270 | 224 | | |
271 | 225 | | |
| |||
303 | 257 | | |
304 | 258 | | |
305 | 259 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | 260 | | |
310 | 261 | | |
311 | 262 | | |
| |||
314 | 265 | | |
315 | 266 | | |
316 | 267 | | |
317 | | - | |
| 268 | + | |
318 | 269 | | |
319 | 270 | | |
320 | 271 | | |
| |||
0 commit comments