Skip to content

removing unneeded typechecks#1439

Merged
Janther merged 1 commit intomainfrom
reviewing-unneeded-typecheck
Mar 8, 2026
Merged

removing unneeded typechecks#1439
Janther merged 1 commit intomainfrom
reviewing-unneeded-typecheck

Conversation

@Janther
Copy link
Copy Markdown
Member

@Janther Janther commented Mar 4, 2026

adding TerminalNode to StrictAstNode definition, with this, we can get rid of node instanceof TerminalNode.

on this same PR we also reviewed every type casting as StrictAstNode and cleaned the types so it wouldn't be necessary anymore. The only downside is that we needed to add a non null assertion since path.parent and path.getNode() can return undefined if we are at the root of the tree which will not happen in our cases and to be honest, the use of as StrictAstNode was already masking the use of the !.

@Janther Janther requested a review from fvictorio March 4, 2026 16:14
@Janther Janther added refactor reorganising the code without changes performance Results in smaller size, better memory usage, or faster execution labels Mar 4, 2026
@Janther Janther force-pushed the reviewing-unneeded-typecheck branch from 0635a93 to 6506b49 Compare March 7, 2026 21:00
@Janther Janther force-pushed the reviewing-unneeded-typecheck branch from 6506b49 to 9d2143b Compare March 8, 2026 13:17
@Janther Janther force-pushed the reviewing-unneeded-typecheck branch from 9d2143b to 2b35720 Compare March 8, 2026 13:21
@Janther Janther merged commit 365e7e0 into main Mar 8, 2026
7 checks passed
@Janther Janther deleted the reviewing-unneeded-typecheck branch March 8, 2026 13:23
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