georgefst / monpad

A fully-customisable web-based gamepad, designed to be used from smartphones.
BSD 3-Clause "New" or "Revised" License
39 stars 5 forks source link

Element List/Map #32

Open georgefst opened 3 years ago

georgefst commented 3 years ago

In 87a9283 removing and updating elements went back to being O(n). What we need is a data structure that gives us efficient lookups and allows us to iterate through all elements in the order they were added. I can't immediately see how this would be done without either O(n) deletions or memory leaks, but apparently Python's default dictionaries manage it. Of course, that data structure needs to be implemented in Haskell and Elm, with working serialisation...

In practice, the layouts might always be small enough that this isn't really an issue.