tilakone icon indicating copy to clipboard operation
tilakone copied to clipboard

Turn ::tk/states into map?

Open DerGuteMoritz opened this issue 3 years ago • 0 comments

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.

DerGuteMoritz avatar Sep 17 '20 11:09 DerGuteMoritz