This yields a performance improvement as well as an increase
in legibility.
Change-Id: Ia7be6a54476a8263d8b5e99f203d7fc3cf374a1d
Signed-off-by: Sonia Farrah <sonia.farrah@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/71939
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
String[] availableTraceTypes = TmfTraceType.getAvailableTraceTypes();
String[] traceTypeList = new String[availableTraceTypes.length + 1];
traceTypeList[0] = TRACE_TYPE_AUTO_DETECT;
- for (int i = 0; i < availableTraceTypes.length; i++) {
- traceTypeList[i + 1] = availableTraceTypes[i];
- }
+ System.arraycopy(availableTraceTypes, 0, traceTypeList, 1, availableTraceTypes.length);
fTraceTypes.setItems(traceTypeList);
fTraceTypes.addSelectionListener(new SelectionAdapter() {
@Override
propertyDescriptorArray[index] = descriptor;
index++;
}
- for (int i = 0; i < sfDescriptors.length; i++) {
- propertyDescriptorArray[index] = sfDescriptors[i];
- index++;
- }
+ System.arraycopy(sfDescriptors, 0, propertyDescriptorArray, index, sfDescriptors.length);
return propertyDescriptorArray;
}
return Arrays.copyOf(sfDescriptors, sfDescriptors.length);