commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [commons-lang] Michael1993 commented on a change in pull request #462: General Code Cleanup
Date Mon, 07 Oct 2019 20:37:27 GMT
Michael1993 commented on a change in pull request #462: General Code Cleanup
URL: https://github.com/apache/commons-lang/pull/462#discussion_r332223874
 
 

 ##########
 File path: src/main/java/org/apache/commons/lang3/CharSet.java
 ##########
 @@ -225,7 +225,7 @@ protected void add(final String str) {
 // NOTE: This is no longer public as CharRange is no longer a public class.
 //       It may be replaced when CharSet moves to Range.
     /*public*/ CharRange[] getCharRanges() {
-        return set.toArray(new CharRange[set.size()]);
+        return set.toArray(new CharRange[0]);
 
 Review comment:
   My bad, that came with Java 11, I was thinking of `stream().toArray()`. (Which I understand
why is not used here.)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message