Segment ends should contain nodeId #1504
originalfoo
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Not bad idea if we could ensure or assume that id or rather its connection with segment won't change (always be valid). I think we should also try to merge obsolete |
Beta Was this translation helpful? Give feedback.
0 replies
-
I added the constructor that takes nodeId in a recent PR #1506; it converts to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've got loads of excess lines of code due to determining
StartNode
practically every time we interact with segment ends.That's almost always determined by
segmentId.ToSegment().IsStartnode(nodeId)
- so this line is appearing over and over and over again.If we stored
nodeId
in segment ends, and had constructor that takessegmentId, nodeId
and works out theStartNode
from that, we could trim lots of code bloat (at the expense of adding aushort
to a struct). This would remove huge numbers ofToSegment()
lookups andIsStartnode()
checks throughtout the codebase.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions