[ https://issues.apache.org/jira/browse/KAFKA-9384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17011285#comment-17011285 ]
ASF GitHub Bot commented on KAFKA-9384: --------------------------------------- guozhangwang commented on pull request #7907: KAFKA-9384; Loop improvements URL: https://github.com/apache/kafka/pull/7907 ---------------------------------------------------------------- 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: us...@infra.apache.org > 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 > Assignee: 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)