Some Enhancements and Refactoring#12440
Closed
xcutiboo wants to merge 1 commit into
Closed
Conversation
|
Please do not open pull requests from the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes significant changes to various files to enhance code maintainability, performance, and documentation. The changes include the addition of utility methods for bit manipulation, improvements to the rate limiter, and detailed JavaDoc comments for better code understanding.
Enhancements and Refactoring:
paper-server/src/main/java/io/papermc/paper/antixray/BitManipulationUtil.java: Introduced a new utility class for common bit manipulation operations to reduce code duplication and improve maintainability.paper-server/src/main/java/io/papermc/paper/antixray/BitStorageReader.javaandpaper-server/src/main/java/io/papermc/paper/antixray/BitStorageWriter.java: Refactored to use the newBitManipulationUtilmethods for reading and writing long values from/to byte arrays and creating bit masks. [1] [2] [3] [4] [5] [6]Performance Improvements:
paper-server/src/main/java/io/papermc/paper/antixray/ChunkPacketBlockControllerAntiXray.java: Enhanced the efficiency ofThreadLocalarrays by pre-initializing them with global values.Documentation Improvements:
paper-server/src/main/java/ca/spottedleaf/moonrise/common/misc/AllocatingRateLimiter.java: Added comprehensive JavaDoc comments to explain the purpose and usage of various methods and the class itself. [1] [2] [3]paper-server/src/main/java/ca/spottedleaf/moonrise/common/util/ThreadUnsafeRandom.java: Added detailed JavaDoc comments to clarify the functionality and thread-safety considerations of the random number generator. [1] [2] [3]Method Improvements:
paper-generator/src/main/java/io/papermc/generator/utils/Formatting.java: Optimized thestripWordOfCamelCaseNamemethod to useStringBuilderfor better performance and reduced intermediate string creation.