Expose ReadOnlyNetworkGraph::get_addresses to C by cloning result#1115
Conversation
3501ac5 to
61c6436
Compare
Codecov Report
@@ Coverage Diff @@
## main #1115 +/- ##
==========================================
+ Coverage 90.67% 91.05% +0.37%
==========================================
Files 66 66
Lines 34684 36648 +1964
==========================================
+ Hits 31449 33369 +1920
- Misses 3235 3279 +44
Continue to review full report at Codecov.
|
|
I'm somewhat partial to cloning. I don't see this used in the code. How do we expect it to be used by users? |
Yea, fair enough, I don't think its worth being annoying about performance here - users shouldn't really be querying this aggressively...
The |
We cannot expose ReadOnlyNetworkGraph::get_addresses as is in C as it returns a list of references to an enum, which the bindings dont support. Instead, we simply clone the result so that it doesn't contain references.
61c6436 to
d2b7f6c
Compare
|
Changed to always cloning the result and exposing the original function, I think its cleaner. |
We cannot expose ReadOnlyNetworkGraph::get_addresses as is in C as
it returns a list of references to an enum, which the bindings
dont support. Instead, we simply clone the result so that it
doesn't contain references.
There's a few options for how to deal with this, one suggested here. We could:
I admittedly don't actually feel super strongly for any of them, just have one here to demonstrate.