Skip to content
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

[Internal] change Java use of instanceof to querying the node type #30

Open
jjg-123 opened this issue Jul 3, 2023 · 0 comments
Open

Comments

@jjg-123
Copy link
Collaborator

jjg-123 commented Jul 3, 2023

A common construct in the code is to check the type of node from the parser, such as StemListNode and do processing using instanceof on the class. This means the code is getting ever more blocks of conditionals based on instanceof. A few of thewse are no problem, but lots of them will slow down code. each node should have an integer type associated with it and switch statements should handle these cases, not blocks of conditionals.

This was initially just s style issue, but as these proliferate, it is becoming a performance issue.

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

No branches or pull requests

1 participant