Skip to content

Commit

Permalink
Replacing generic java hashset with IntHashSet to remove boxing/unbox…
Browse files Browse the repository at this point in the history
…ing of Integer.
  • Loading branch information
Steven Warwick committed Oct 8, 2018
1 parent 060a9f3 commit 6c275e8
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.agrona.collections.IntHashSet;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;

import static com.epam.cme.mdp3.MdConstants.INCR_RFRSH_MD_ENTRY_TYPE;
Expand All @@ -41,7 +40,7 @@ public class ChannelControllerRouter implements MdpChannelController {
private final String channelId;
private List<Integer> mboIncrementMessageTemplateIds;
private List<Integer> mboSnapshotMessageTemplateIds;
private Set<Integer> securityIds = new HashSet<>();
private IntHashSet securityIds = new IntHashSet();

public ChannelControllerRouter(String channelId, InstrumentManager instrumentManager,
MdpMessageTypes mdpMessageTypes, List<ChannelListener> channelListeners,
Expand Down Expand Up @@ -134,8 +133,8 @@ protected void routeMBPEntry(int securityId, MdpMessage mdpMessage, MdpGroupEntr
}
}

protected void routeIncrementalComplete(Set<Integer> securityIds, MdpMessage mdpMessage, long msgSeqNum) {
for (Integer securityId : securityIds) {
protected void routeIncrementalComplete(IntHashSet securityIds, MdpMessage mdpMessage, long msgSeqNum) {
for (int securityId : securityIds) {
InstrumentController instrumentController = instrumentManager.getInstrumentController(securityId);
if (instrumentController != null) {
instrumentController.handleIncrementalComplete(mdpMessage, msgSeqNum);
Expand Down

0 comments on commit 6c275e8

Please sign in to comment.