presize ArrayList
Change-Id: I0805991630a896da260b28a6cef7841593f020a9
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -172,7 +172,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr | ... | @@ -172,7 +172,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr |
172 | */ | 172 | */ |
173 | private List<PortDescription> buildPortDescriptions( | 173 | private List<PortDescription> buildPortDescriptions( |
174 | List<OFPortDesc> ports) { | 174 | List<OFPortDesc> ports) { |
175 | - final List<PortDescription> portDescs = new ArrayList<>(); | 175 | + final List<PortDescription> portDescs = new ArrayList<>(ports.size()); |
176 | for (OFPortDesc port : ports) { | 176 | for (OFPortDesc port : ports) { |
177 | portDescs.add(buildPortDescription(port)); | 177 | portDescs.add(buildPortDescription(port)); |
178 | } | 178 | } | ... | ... |
-
Please register or login to post a comment