Commit caf01fa
committed
Merge #130: refactor: Add CleanupRun function to dedup clean list code
700085f refactor: Add CleanupRun function to dedup clean list code (Ryan Ofsky)
Pull request description:
Add CleanupRun function to dedup clean list code. Also rename "cleanup" variables to distinguish between cleanup iterators and cleanup callback functions.
These changes were originally part of #126 which was closed for other reasons, but I think they are still helpful and make code easier to navigate.
Since this renames a public struct member, it will require a change to bitcoin core when the depends version is bumped:
```c++
diff --git a/src/ipc/capnp/protocol.cpp b/src/ipc/capnp/protocol.cpp
index 4b67a5bd1e36..691bdf5f9242 100644
--- a/src/ipc/capnp/protocol.cpp
+++ b/src/ipc/capnp/protocol.cpp
@@ -73,7 +73,7 @@ public:
}
void addCleanup(std::type_index type, void* iface, std::function<void()> cleanup) override
{
- mp::ProxyTypeRegister::types().at(type)(iface).cleanup.emplace_back(std::move(cleanup));
+ mp::ProxyTypeRegister::types().at(type)(iface).cleanup_fns.emplace_back(std::move(cleanup));
}
Context& context() override { return m_context; }
void startLoop(const char* exe_name)
```
Top commit has no ACKs.
Tree-SHA512: 04ca403f80ddc2d0bf6ba5b0aa5cee651f0c509dcf67137789c744a1ae63bed32a4e34510ba21f2ed9797c46ace640b49e2db67659e03ea4ad2cca18491cabefFile tree
4 files changed
+33
-29
lines changed- include/mp
- src/mp
- test/mp/test
4 files changed
+33
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
| 443 | + | |
446 | 444 | | |
447 | 445 | | |
448 | 446 | | |
| |||
479 | 477 | | |
480 | 478 | | |
481 | 479 | | |
482 | | - | |
| 480 | + | |
483 | 481 | | |
484 | | - | |
485 | | - | |
486 | | - | |
| 482 | + | |
487 | 483 | | |
488 | 484 | | |
489 | | - | |
| 485 | + | |
490 | 486 | | |
491 | 487 | | |
492 | 488 | | |
| |||
512 | 508 | | |
513 | 509 | | |
514 | 510 | | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
| 511 | + | |
519 | 512 | | |
520 | 513 | | |
521 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
147 | 155 | | |
148 | 156 | | |
149 | 157 | | |
150 | | - | |
| 158 | + | |
151 | 159 | | |
152 | 160 | | |
153 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
310 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
311 | 314 | | |
312 | 315 | | |
313 | 316 | | |
314 | | - | |
| 317 | + | |
315 | 318 | | |
316 | | - | |
317 | | - | |
318 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
0 commit comments