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

refactor: Refactor collections for better performance, readability, and maintainability #296

Merged
merged 5 commits into from
Dec 4, 2024

Conversation

MSDarwish2000
Copy link
Member

  • refactor: Remove not needed ObjectList and its related code
  • refactor: Update ScatterMap to latest commit without modifications
  • refactor: Apply required changes to ScatterMap
  • refactor: Refactor collections for easier-to-maintain code

@MSDarwish2000 MSDarwish2000 enabled auto-merge (squash) December 4, 2024 19:03
@MSDarwish2000 MSDarwish2000 force-pushed the refactor/collections branch 3 times, most recently from ae3baac to 388ea7c Compare December 4, 2024 21:15
Latest commit is b63ae48 (2024-11-08 2:47 PST)

Signed-off-by: Mohamed Darwish <[email protected]>
The changes include:
- Renaming package to `com.mayakapps.kache.collection`.
- Setting top-level declarations visibility to internal.
- Adding dummy @PublishedApi to avoid exposing internal code
- Removing functions that accept `ScatterSet` and `ObjectList` and their tests as these types are not included or needed.
- Add `keySet` property to `ScatterMap`.
- Add `onAccess()` to `ScatterMap` and `onInsertion()`, `onReplacement()`, and `onRemoval()` to `MutableScatterMap` with appropriate calls to them.
- Make `forEachIndexed()` use the chain if the map is `MutableChainedScatterMap`.
- Increase `initializeStorage()` and `findFirstAvailableSlot()` visibility to be called from `MutableChainedScatterMap.resizeStorage()`.
- Open `MutableScatterMap`, `clear()`, and `resizeStorage()` to inheritance.

Signed-off-by: Mohamed Darwish <[email protected]>
@MSDarwish2000 MSDarwish2000 merged commit 02f6315 into main Dec 4, 2024
4 checks passed
@MSDarwish2000 MSDarwish2000 deleted the refactor/collections branch December 4, 2024 21:35
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.

1 participant