Commit 1e2c29f
committed
prevector: destroy elements only via erase()
Fixes a bug in which pop_back did not call the deleted item's destructor.
Using the most general erase() implementation to implement all the others
prevents similar bugs because the coupling between deallocation and destructor
invocation only needs to be maintained in one place.
Also reduces duplication of complex memmove logic.1 parent 73fc922 commit 1e2c29f
1 file changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
303 | | - | |
| 301 | + | |
| 302 | + | |
304 | 303 | | |
305 | 304 | | |
306 | 305 | | |
| |||
368 | 367 | | |
369 | 368 | | |
370 | 369 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 370 | + | |
375 | 371 | | |
376 | 372 | | |
377 | 373 | | |
| |||
396 | 392 | | |
397 | 393 | | |
398 | 394 | | |
399 | | - | |
| 395 | + | |
400 | 396 | | |
401 | 397 | | |
402 | 398 | | |
| |||
0 commit comments