[
https://issues.apache.org/jira/browse/STORM-1152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14983247#comment-14983247
]
ASF GitHub Bot commented on STORM-1152:
---------------------------------------
Github user hmcl commented on a diff in the pull request:
https://github.com/apache/storm/pull/836#discussion_r43548584
--- Diff: storm-core/src/jvm/backtype/storm/utils/TransferDrainer.java ---
@@ -30,18 +31,20 @@
private HashMap<Integer, ArrayList<ArrayList<TaskMessage>>> bundles =
new HashMap();
public void add(HashMap<Integer, ArrayList<TaskMessage>>
taskTupleSetMap) {
- for (Integer task : taskTupleSetMap.keySet()) {
- addListRefToMap(this.bundles, task, taskTupleSetMap.get(task));
+ for (Map.Entry<Integer, ArrayList<TaskMessage>> entry :
taskTupleSetMap.entrySet()) {
+ Integer task = entry.getKey();
+ addListRefToMap(this.bundles, task, entry.getValue());
--- End diff --
Perhaps this could be simplified to addListRefToMap(this.bundles,
entry.getKey(), entry.getValue());
> Change map keySet iteration to entrySet iteration for efficiency
> ----------------------------------------------------------------
>
> Key: STORM-1152
> URL: https://issues.apache.org/jira/browse/STORM-1152
> Project: Apache Storm
> Issue Type: Improvement
> Components: storm-core
> Reporter: Suresh Srinivas
> Assignee: Suresh Srinivas
> Priority: Minor
>
> Many places keySet iteration is used where entrySet iteration would avoid
> unnecessary key lookup.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)