Skip to content

Conversation

@cacfd3a
Copy link

@cacfd3a cacfd3a commented Nov 6, 2022

I was digging through the code and I a portion that might benefit from more efficient traversal.

Currently, stateKeys uses CopyOnWriteArrayList, presumably in order to iterate the list at that point while also removing entries from the list. dispose performs a linear search when disposing a screen, filtering all those entries which match the prefix of the screen key.

I reckon:

  1. The search could be speeded up by taking advantage of the orderedness of strings
  2. I thought the list might be better represented as a Set. I've noticed with the master-detail example, clicking an item and going back, that the list was polluted with entries for Screen#0, which should be conflated (right?).

I haven't done a complete implementation for KMM, just want to sketch out the idea and ask if it looks reasonable to you. Perhaps I am overlooking something, like a race condition you're more aware of than I am.

Let me know what you think!

@hafiz013
Copy link

hafiz013 commented Jul 4, 2025

any change want to review this code

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

Successfully merging this pull request may close these issues.

2 participants