Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/227#discussion_r20788933
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/operators/hash/CompactingHashTable.java
 ---
    @@ -718,8 +719,7 @@ private void createPartitions(int numPartitions) {
        }
        
        private void clearPartitions() {
    -           for (int i = 0; i < this.partitions.size(); i++) {
    -                   InMemoryPartition<T> p = this.partitions.get(i);
    +           for (InMemoryPartition<T> p : this.partitions) {
    --- End diff --
    
    The for-each syntax creates an iterator, while the for loop with indexes 
does not. 
    I think this is not critical here, but in general, I have used the indexed 
access in some parts on purpose to avoid iterator creation and circumvent the 
danger of a concurrent modification exception.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to