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

Improve handling of Role#getPosition and canInteract #2085

Merged
merged 2 commits into from
Apr 12, 2022

Conversation

MinnDevelopment
Copy link
Member

Pull Request Etiquette

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

This improves the user experience for RoleDeleteEvent and allows Role#getPosition to still be usable once it's detached from cache. This position value is naturally not accurate for long, but still good enough for informational purposes at the time of deletion. Like any other entity value, this drifts over time after detaching from cache.

Additionally, this optimizes Role#canInteract(Role) by not re-calculating positions for both roles each time. We can completely rely on compareTo as this is only a relative comparison, rather than absolute positions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants