Skip to content

Conversation

@0hmX
Copy link
Contributor

@0hmX 0hmX commented Dec 22, 2025

Nutshell: We were counting the layer transition twice;

  • Simplified getIntraNodeCrossings: Removed the redundant numTransitions return value and the manual numEntryExitLayerChanges counter. Both are now consolidated into a single numEntryExitLayerChanges field derived directly from transitionPairPoints.length.

  • Updated MultiHeadPolyLineIntraNodeSolver: Aligned the solver with these changes by renaming its internal usage of numTransitions to numEntryExitLayerChanges.

  • Improved Maintainability: The logic now has a single source of truth for layer-change counts, reducing the risk of divergent values.

…NodeCrossings

- Simplified getIntraNodeCrossings: Removed the redundant numTransitions return value and the manual numEntryExitLayerChanges counter. Both are now consolidated into a single numEntryExitLayerChanges field derived directly from transitionPairPoints.length.

- Updated MultiHeadPolyLineIntraNodeSolver: Aligned the solver with these changes by renaming its internal usage of numTransitions to numEntryExitLayerChanges.

- Improved Maintainability: The logic now has a single source of truth for layer-change counts, reducing the risk of divergent values.
@vercel
Copy link

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
capacity-node-autorouter Ready Ready Preview, Comment Dec 22, 2025 2:28pm

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fine but i'm trying to understand your description, isn't this a noop change? Like the functionality is the same? I don't understand in the description how you said we're counting something twice- it seems like this is just a refactor to remove numTransitions?

@seveibar
Copy link
Contributor

can you merge after #437, just trying to make sure #437 can get live

@0hmX
Copy link
Contributor Author

0hmX commented Dec 23, 2025

@seveibar I also removed a variable called numEntryExitLayerChanges, which is the same as transitionPairPoints.length, and also removed the extra numTransitions from the return type

@0hmX 0hmX merged commit c03fd1f into main Dec 23, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants