# HG changeset patch # User Josef Eisl # Date 1449847757 -3600 # Node ID c37db3aa7e43d4582d3e7b7ca1e465594cdd0ff0 # Parent 8e047438082221c030132deab54d0e1e98a25cbc MoveProfiling: minor improvement. diff -r 8e0474380822 -r c37db3aa7e43 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java Tue Dec 15 17:20:29 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java Fri Dec 11 16:29:17 2015 +0100 @@ -155,10 +155,11 @@ increments.add(new ConstantValue(target.getLIRKind(JavaKind.Int), JavaConstant.forInt(i))); } } - String[] groups = new String[names.size()]; - Arrays.fill(groups, "MoveOperations"); - if (names.size() > 0) { // Don't pollute LIR when nothing has to be done - LIRInstruction inst = counterFactory.createMultiBenchmarkCounter(names.toArray(new String[0]), groups, increments.toArray(new Value[0])); + int size = names.size(); + if (size > 0) { // Don't pollute LIR when nothing has to be done + String[] groups = new String[size]; + Arrays.fill(groups, "MoveOperations"); + LIRInstruction inst = counterFactory.createMultiBenchmarkCounter(names.toArray(new String[size]), groups, increments.toArray(new Value[size])); assert inst != null; buffer.init(instructions); buffer.append(1, inst);