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

Simplify and deduplicate PaperweightGetBlocks#update logic #3055

Merged
merged 2 commits into from
Jan 11, 2025

Conversation

SirYwell
Copy link
Member

@SirYwell SirYwell commented Jan 2, 2025

Overview

Description

We can simplify the logic in the update method:

  • Avoid filling the array if all of its content is written later anyway
  • Move version-independent loops to common supertype
  • Use Arrays.fill instead of manual loops where possible

This also helps avoiding going through hard-to-optimize initialization check code every iteration instead of only once before

Submitter Checklist

Preview Give feedback

@SirYwell SirYwell requested a review from a team as a code owner January 2, 2025 10:15
@github-actions github-actions bot added the chore label Jan 2, 2025
@dordsor21 dordsor21 requested a review from a team January 7, 2025 20:47
@dordsor21 dordsor21 merged commit aa03f18 into main Jan 11, 2025
11 checks passed
@dordsor21 dordsor21 deleted the refactor/PGB-update-cleanup branch January 11, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants