Fix branchedResetPropagation #57
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: profectus/Profectus#57
Loading…
Reference in a new issue
No description provided.
Delete branch "nif/Profectus-Niffix:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
BREAKING CHANGE - Forces branches to be directed
Signed-off-by: nif nif@incremental.social
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;
instead of
=== undefined
, can you use== null
? That matches the rest of the codebase and has subtly different behavior.You very well could, I didn't realise that
== null
tested forundefined
@ -369,0 +343,4 @@
let reset: GenericTreeNode[] = [];
let current = [resettingNode];
while (current.length != 0) {
let next: GenericTreeNode[] = [];
The linter says next, node, and link should all be
const
that's probably because i use
Array.prototype.concat
andArray.prototype.push
instead of reassigning them@ -369,0 +351,4 @@
link.endNode.reset?.reset();
}
};
reset = reset.concat(current);
This line is fine, but I wonder why you don't just
push
like you do thenext
array.because then that gives a shaped array that can't be iterated over as well
wait no i could have
.push(...
'edI have made the changes you requested.