You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/06/29 20:27:10 UTC

[GitHub] [commons-codec] arturobernalg opened a new pull request, #136: Remove redundant operations.

arturobernalg opened a new pull request, #136:
URL: https://github.com/apache/commons-codec/pull/136

   Remove redundant operations. Clear operations on empty collections have no effect and can be removed.


-- 
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


[GitHub] [commons-codec] arturobernalg commented on a diff in pull request #136: Remove redundant operations.

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on code in PR #136:
URL: https://github.com/apache/commons-codec/pull/136#discussion_r912395548


##########
src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java:
##########
@@ -494,9 +494,6 @@ private String[] soundex(final String source, final boolean branching) {
 
             for (final Rule rule : rules) {
                 if (rule.matches(inputContext)) {
-                    if (branching) {
-                        nextBranches.clear();
-                    }

Review Comment:
   'nextBranches' is always empty collections.  The loop will be exit  in the line 525  with the `break` in the first iterations or/and when the rule match ` if (rule.matches(inputContext))`. So, at the end its always empty and its redundant. 



-- 
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


[GitHub] [commons-codec] arturobernalg commented on a diff in pull request #136: Remove redundant operations.

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on code in PR #136:
URL: https://github.com/apache/commons-codec/pull/136#discussion_r912395548


##########
src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java:
##########
@@ -494,9 +494,6 @@ private String[] soundex(final String source, final boolean branching) {
 
             for (final Rule rule : rules) {
                 if (rule.matches(inputContext)) {
-                    if (branching) {
-                        nextBranches.clear();
-                    }

Review Comment:
   'nextBranches' is always empty collections.  The loop will be exit  in the line 525  with the `break` in the first iterations or/and when the rule match ` if (rule.matches(inputContext))`. So, at the end its always empty and its redundant. 
   
   If we remove the break of the line, that is a whole new history :)



-- 
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


[GitHub] [commons-codec] codecov-commenter commented on pull request #136: Remove redundant operations.

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #136:
URL: https://github.com/apache/commons-codec/pull/136#issuecomment-1170463629

   # [Codecov](https://codecov.io/gh/apache/commons-codec/pull/136?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#136](https://codecov.io/gh/apache/commons-codec/pull/136?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (222b3ed) into [master](https://codecov.io/gh/apache/commons-codec/commit/c1078a02dbe270d1dbffda8bd01dffa678cfd60a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c1078a0) will **decrease** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master     #136      +/-   ##
   ============================================
   - Coverage     92.16%   92.16%   -0.01%     
   + Complexity     1746     1745       -1     
   ============================================
     Files            67       67              
     Lines          4658     4656       -2     
     Branches        748      747       -1     
   ============================================
   - Hits           4293     4291       -2     
     Misses          249      249              
     Partials        116      116              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/commons-codec/pull/136?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../commons/codec/language/DaitchMokotoffSoundex.java](https://codecov.io/gh/apache/commons-codec/pull/136/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2NvbW1vbnMvY29kZWMvbGFuZ3VhZ2UvRGFpdGNoTW9rb3RvZmZTb3VuZGV4LmphdmE=) | `85.71% <ø> (-0.17%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/commons-codec/pull/136?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/commons-codec/pull/136?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c1078a0...222b3ed](https://codecov.io/gh/apache/commons-codec/pull/136?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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


[GitHub] [commons-codec] kinow commented on a diff in pull request #136: Remove redundant operations.

Posted by GitBox <gi...@apache.org>.
kinow commented on code in PR #136:
URL: https://github.com/apache/commons-codec/pull/136#discussion_r910399681


##########
src/main/java/org/apache/commons/codec/language/DaitchMokotoffSoundex.java:
##########
@@ -494,9 +494,6 @@ private String[] soundex(final String source, final boolean branching) {
 
             for (final Rule rule : rules) {
                 if (rule.matches(inputContext)) {
-                    if (branching) {
-                        nextBranches.clear();
-                    }

Review Comment:
   Isn't that to force a `clear()` when `nextBranches` is not an empty collection?
   
   ```
   nextBranches = branching ? new ArrayList<>() : Collections.emptyList();
   ```



-- 
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


[GitHub] [commons-codec] arturobernalg closed pull request #136: Remove redundant operations.

Posted by "arturobernalg (via GitHub)" <gi...@apache.org>.
arturobernalg closed pull request #136: Remove redundant operations.
URL: https://github.com/apache/commons-codec/pull/136


-- 
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