minor: Remove redundant shift and offset operations in EndianUtils#830
Closed
KishorMore-2005 wants to merge 1 commit intoapache:masterfrom
Closed
minor: Remove redundant shift and offset operations in EndianUtils#830KishorMore-2005 wants to merge 1 commit intoapache:masterfrom
KishorMore-2005 wants to merge 1 commit intoapache:masterfrom
Conversation
327d134 to
aee7641
Compare
Member
|
-1 and closing: I think this class was originally authored in this style for readability, which is subjective I'll grant. |
Contributor
|
Agreed: having the zeros in place shows that they are part of the sequence of values, rather than a special case. This is obvious here: commons-io/src/main/java/org/apache/commons/io/EndianUtils.java Lines 122 to 125 in 4708e98 Less so here: That instance seems to have lots its original layout: commons-io/src/java/org/apache/commons/io/EndianUtils.java Lines 390 to 393 in a330996 It might be worth resorting to the original layout throughout, but that is a separate issue. |
Contributor
Author
|
okay , Thank you for explanation! |
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.
Removes redundant bit shift and arithmetic operations (<< 0, >> 0, + 0)
from EndianUtils methods. These operations have no effect on values and
were making the code unnecessarily verbose. No functional changes.