Fix branchedResetPropagation #57

Merged
thepaperpilot merged 3 commits from nif/Profectus-Niffix:main into main 2024-02-14 17:39:07 +00:00
Contributor

BREAKING CHANGE - Forces branches to be directed

Signed-off-by: nif nif@incremental.social

BREAKING CHANGE - Forces branches to be directed Signed-off-by: nif <nif@incremental.social>
nif added 1 commit 2024-02-12 19:46:51 +00:00
Fix branchedResetPropagation
Some checks failed
Run Tests / test (pull_request) Has been cancelled
5e32fa4985
BREAKING CHANGE - Forces branches to be directed

Signed-off-by: nif <nif@incremental.social>
thepaperpilot requested changes 2024-02-13 14:23:41 +00:00
thepaperpilot left a comment
Collaborator

I wrote some regression tests, and they failed before this PR and passed after, so the logic looks good but I had some notes about the code itself.

I wrote some regression tests, and they failed before this PR and passed after, so the logic looks good but I had some notes about the code itself.
@ -367,2 +341,2 @@
visitedNodes.push(...currentNodes);
}
const links = unref(tree.branches);
if (links === undefined) return;
Collaborator

instead of === undefined, can you use == null? That matches the rest of the codebase and has subtly different behavior.

instead of `=== undefined`, can you use `== null`? That matches the rest of the codebase and has subtly different behavior.
Author
Contributor

You very well could, I didn't realise that == null tested for undefined

You very well could, I didn't realise that `== null` tested for `undefined`
@ -369,0 +343,4 @@
let reset: GenericTreeNode[] = [];
let current = [resettingNode];
while (current.length != 0) {
let next: GenericTreeNode[] = [];
Collaborator

The linter says next, node, and link should all be const

The linter says next, node, and link should all be `const`
Author
Contributor

that's probably because i use Array.prototype.concat and Array.prototype.push instead of reassigning them

that's probably because i use `Array.prototype.concat` and `Array.prototype.push` instead of reassigning them
@ -369,0 +351,4 @@
link.endNode.reset?.reset();
}
};
reset = reset.concat(current);
Collaborator

This line is fine, but I wonder why you don't just push like you do the next array.

This line is fine, but I wonder why you don't just `push` like you do the `next` array.
Author
Contributor

because then that gives a shaped array that can't be iterated over as well

because then that gives a shaped array that can't be iterated over as well
Author
Contributor

wait no i could have .push(...'ed

wait no i could have `.push(...`'ed
nif added 1 commit 2024-02-14 15:56:26 +00:00
Requested changes
Some checks failed
Run Tests / test (pull_request) Has been cancelled
263c951cf8
Author
Contributor

I have made the changes you requested.

I have made the changes you requested.
thepaperpilot added 1 commit 2024-02-14 17:38:54 +00:00
Merge branch 'main' into main
Some checks failed
Run Tests / test (pull_request) Failing after 2m5s
04a5e963ab
thepaperpilot merged commit cba79df80d into main 2024-02-14 17:39:07 +00:00
Sign in to join this conversation.
No description provided.