-
-
Notifications
You must be signed in to change notification settings - Fork 133
feat(web): implement SearchQuotientCluster merging 🚂 #15516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: change/web/add-same-edge-detection
Are you sure you want to change the base?
feat(web): implement SearchQuotientCluster merging 🚂 #15516
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
1f4897f to
56d7a8f
Compare
407cb6d to
edf4712
Compare
d4f3a18 to
1755556
Compare
This PR serves to implement SearchQuotientCluster.merge() in full. If two halves of a previous .split() operation are passed in, they should be fully remerged - into a single, refused SearchQuotientNode segment. Build-bot: skip build:web Test-bot: skip
edf4712 to
6150186
Compare
| thisTailSpaceIds.find((entry) => entry == space.inputSource.subsetId) | ||
| && thisTailInputSource.end == spaceHeadInputSource.start; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be better to use Array.some here. Theoretically space.inputSource.subsetId can be 0 in which case Array.find would also return 0 i.e. falsy, and so isOnSplitInput would be false even though it should be true. I'm pretty sure this can't happen in our implementation (even though I don't know why), but using Array.some would be cleaner IMO (or thisTailSpaceIds.find(...) !== undefined)
| thisTailSpaceIds.find((entry) => entry == space.inputSource.subsetId) | |
| && thisTailInputSource.end == spaceHeadInputSource.start; | |
| thisTailSpaceIds.some((entry) => entry == space.inputSource.subsetId) | |
| && thisTailInputSource.end == spaceHeadInputSource.start; |
| // a prior split; if we'd split, it'd be a SearchQuotientCluster on both | ||
| // ends. | ||
| if(space instanceof SearchQuotientSpur) { | ||
| const parentMerge = this.merge(space.parents[0]) as SearchQuotientSpur; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
construct takes a SearchQuotientNode, so there's no need to cast to a SearchQuotientSpur.
| const parentMerge = this.merge(space.parents[0]) as SearchQuotientSpur; | |
| const parentMerge = this.merge(space.parents[0]); |
This PR serves to implement SearchQuotientCluster.merge() in full. If two halves of a previous .split() operation are passed in, they should be fully remerged - into a single, refused SearchQuotientNode segment.
Build-bot: skip build:web
Test-bot: skip