You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "KishorMore-2005 (via GitHub)" <gi...@apache.org> on 2026/02/08 07:09:20 UTC

[PR] minor: Remove redundant shift and offset operations in EndianUtils [commons-io]

KishorMore-2005 opened a new pull request, #830:
URL: https://github.com/apache/commons-io/pull/830

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] minor: Remove redundant shift and offset operations in EndianUtils [commons-io]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #830:
URL: https://github.com/apache/commons-io/pull/830#issuecomment-3867044203

   -1 and closing: I think this class was originally authored in this style for readability, which is subjective I'll grant.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] minor: Remove redundant shift and offset operations in EndianUtils [commons-io]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory closed pull request #830: minor: Remove redundant shift and offset operations in EndianUtils
URL: https://github.com/apache/commons-io/pull/830


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] minor: Remove redundant shift and offset operations in EndianUtils [commons-io]

Posted by "sebbASF (via GitHub)" <gi...@apache.org>.
sebbASF commented on PR #830:
URL: https://github.com/apache/commons-io/pull/830#issuecomment-3867069117

   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:
   
   https://github.com/apache/commons-io/blob/4708e989cb6f1e4961ddc365a6c3e31a60d704ec/src/main/java/org/apache/commons/io/EndianUtils.java#L122-L125
   
   Less so here:
   
   https://github.com/apache/commons-io/blob/4708e989cb6f1e4961ddc365a6c3e31a60d704ec/src/main/java/org/apache/commons/io/EndianUtils.java#L140
   
   That instance seems to have lots its original layout:
   
   https://github.com/apache/commons-io/blob/a330996bf5514705e476d491069b1a4a65794023/src/java/org/apache/commons/io/EndianUtils.java#L390-L393
   
   It might be worth resorting to the original layout throughout, but that is a separate issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] minor: Remove redundant shift and offset operations in EndianUtils [commons-io]

Posted by "KishorMore-2005 (via GitHub)" <gi...@apache.org>.
KishorMore-2005 commented on PR #830:
URL: https://github.com/apache/commons-io/pull/830#issuecomment-3867322711

   okay , Thank you for explanation!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org