[ https://issues.apache.org/jira/browse/KAFKA-9384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17010841#comment-17010841 ]
Guozhang Wang commented on KAFKA-9384: -------------------------------------- [~high.lee] I've added you as a contributor and assign this to you. > Loop improvements > ------------------ > > Key: KAFKA-9384 > URL: https://issues.apache.org/jira/browse/KAFKA-9384 > Project: Kafka > Issue Type: Improvement > Components: streams > Affects Versions: 2.4.0 > Reporter: highluck > Priority: Minor > Fix For: 2.4.0 > > > Loop improvements > [streams/src/main/java/org/apache/kafka/streams/state/internals/AbstractSegments.java|https://github.com/apache/kafka/pull/7277/files#diff-337cba828184b5a77a6b1472697b758a] > I think we can improve this loop > > {code:java} > // 코드 자리 표시자 > final long[] segmentIds = new long[list.length]; > for (int i = 0; i < list.length; i++) { > segmentIds[i] = segmentIdFromSegmentName(list[i], dir); > } > // open segments in the id order > Arrays.sort(segmentIds); > for (final long segmentId : segmentIds) { > if (segmentId >= 0) { > getOrCreateSegment(segmentId, context); > } > } > {code} > -- This message was sent by Atlassian Jira (v8.3.4#803005)