Skip to content

Cleaning up variant logic#1209

Merged
Janther merged 6 commits intomainfrom
cleaning-up-variant-logic
Jul 29, 2025
Merged

Cleaning up variant logic#1209
Janther merged 6 commits intomainfrom
cleaning-up-variant-logic

Conversation

@Janther
Copy link
Copy Markdown
Member

@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