Skip to content

Commit 3f6357e

Browse files
Minor Improvement: (apache#130)
* System.arraycopy * Remove redundant initializer * Use empty array
1 parent af84037 commit 3f6357e

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/test/java/org/apache/commons/csv/CSVBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public int parseSkifeCSV(final Blackhole bh) throws Exception {
184184
}
185185

186186
private static class CountingReaderCallback implements org.skife.csv.ReaderCallback {
187-
public int count = 0;
187+
public int count;
188188

189189
@Override
190190
public void onRow(final String[] fields) {

src/test/java/org/apache/commons/csv/PerformanceTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class PerformanceTest {
6363

6464
private static int max = 11; // skip first test
6565

66-
private static int num = 0; // number of elapsed times recorded
66+
private static int num; // number of elapsed times recorded
6767
private static final long[] ELAPSED_TIMES = new long[max];
6868

6969
private static final CSVFormat format = CSVFormat.EXCEL;
@@ -91,9 +91,7 @@ public static void main(final String [] args) throws Exception {
9191
final String[] tests;
9292
if (argc > 1) {
9393
tests = new String[argc - 1];
94-
for (int i = 1; i < argc; i++) {
95-
tests[i - 1] = args[i];
96-
}
94+
System.arraycopy(args, 1, tests, 0, argc - 1);
9795
} else {
9896
tests = new String[] { "file", "split", "extb", "exts", "csv", "csv-path", "csv-path-db", "csv-url", "lexreset", "lexnew" };
9997
}

0 commit comments

Comments
 (0)