[ 
https://issues.apache.org/jira/browse/KAFKA-9384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17010369#comment-17010369
 ] 

ASF GitHub Bot commented on KAFKA-9384:
---------------------------------------

highluck commented on pull request #7907: KAFKA-9384; Loop improvements
URL: https://github.com/apache/kafka/pull/7907
 
 
   3 loops in one and this immutable
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
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
>            Priority: Major
>             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)

Reply via email to