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

Turn ::tk/states into map? #8

Open
DerGuteMoritz opened this issue Sep 17, 2020 · 0 comments
Open

Turn ::tk/states into map? #8

DerGuteMoritz opened this issue Sep 17, 2020 · 0 comments

Comments

@DerGuteMoritz
Copy link

Hi,

thanks for this neat little library! While exploring it, I was wondering why ::tk/states is a sequence of maps with ::tk/name rather than a map with ::tk/name as keys. The latter would take care of preventing duplicate state definitions (which AFAICT don't serve a purpose and aren't detected by the validation function right now) as well as improve performance for large state machines because currently, each state lookup requires a linear search. I'm happy to provide a patch if you're interested. If so, let me know if you would like to retain backwards compatibility with the current API.

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