garydgregory commented on code in PR #375: URL: https://github.com/apache/commons-text/pull/375#discussion_r1009545056
########## src/main/java/org/apache/commons/text/AlphabetConverter.java: ########## @@ -104,11 +104,7 @@ private static Integer[] convertCharsToIntegers(final Character[] chars) { if (ArrayUtils.isEmpty(chars)) { return ArrayUtils.EMPTY_INTEGER_OBJECT_ARRAY; } - final Integer[] integers = new Integer[chars.length]; - for (int i = 0; i < chars.length; i++) { - integers[i] = (int) chars[i]; - } - return integers; + return Arrays.stream(chars).map(aChar -> (int) aChar).toArray(Integer[]::new); Review Comment: You don't need streams @arturobernalg Why not just: ``` final Integer[] integers = new Integer[chars.length]; Arrays.setAll(integers, i -> (int) chars[i]); ``` ? -- 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-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org