Skip to content

VirtualMapState should not be in VirtualMap if the map is empty #19223

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

Open
imalygin opened this issue May 15, 2025 · 0 comments
Open

VirtualMapState should not be in VirtualMap if the map is empty #19223

imalygin opened this issue May 15, 2025 · 0 comments
Assignees
Milestone

Comments

@imalygin
Copy link
Contributor

In the current implementation of Virtual Mega Map there is always an instance of VirtualMapState which contains metadata for the map. There are two issues with this approach:

  • a map is never empty and therefore isEmpty method lost its meaning
  • it's a manifestation of a "leaking abstraction" - though technically VirtualMapState is an element of the map, it doesn't have the business meaning like other elements in the map and, therefore, should be hidden as much as possible.

A proposed solution is to hide this element when the map is empty

  • if it's the only element that is present in the map, isEmpty should return true and size() should return 0
@imalygin imalygin added this to the v0.63 milestone May 15, 2025
@imalygin imalygin self-assigned this May 15, 2025
@imalygin imalygin moved this to Not Started in Foundation Team May 16, 2025
@imalygin imalygin marked this as a duplicate of #19160 May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Not Started
Development

No branches or pull requests

1 participant