Skip to content

Cleaning up variant logic #1209

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

Merged
merged 6 commits into from
Jul 29, 2025
Merged

Cleaning up variant logic #1209

merged 6 commits into from
Jul 29, 2025

Conversation

Janther
Copy link
Contributor

@Janther Janther commented Jul 21, 2025

Main changes:

  • we return early if the variant is a Terminal node since we don't have to calculate new loc or comments and avoid having to check again at the end.
  • storing variant and variantKind so we don't have to check every time.
  • adding a printVariant helper to standardise the printing of variants

@Janther Janther requested a review from fvictorio July 21, 2025 15:14
@Janther Janther added refactor reorganising the code without changes performance Results in smaller size, better memory usage, or faster execution labels Jul 22, 2025
@Janther Janther force-pushed the cleaning-up-variant-logic branch 2 times, most recently from 137cfca to 02f502f Compare July 26, 2025 20:41
@Janther Janther force-pushed the cleaning-up-variant-logic branch from 02f502f to 13d3b20 Compare July 26, 2025 20:44
@Janther Janther merged commit e1a7e70 into main Jul 29, 2025
7 checks passed
@Janther Janther deleted the cleaning-up-variant-logic branch July 29, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Results in smaller size, better memory usage, or faster execution refactor reorganising the code without changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants