This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-csv.git
The following commit(s) were added to refs/heads/master by this push:
new 3f6357e Minor Improvement: (#130)
3f6357e is described below
commit 3f6357e8f4fea71c10cca4e01b402f7670b656b0
Author: Arturo Bernal <[email protected]>
AuthorDate: Sat Jul 3 20:39:49 2021 +0200
Minor Improvement: (#130)
* System.arraycopy
* Remove redundant initializer
* Use empty array
---
src/test/java/org/apache/commons/csv/CSVBenchmark.java | 2 +-
src/test/java/org/apache/commons/csv/PerformanceTest.java | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/commons/csv/CSVBenchmark.java
b/src/test/java/org/apache/commons/csv/CSVBenchmark.java
index e061dd2..ebcd421 100644
--- a/src/test/java/org/apache/commons/csv/CSVBenchmark.java
+++ b/src/test/java/org/apache/commons/csv/CSVBenchmark.java
@@ -184,7 +184,7 @@ public class CSVBenchmark {
}
private static class CountingReaderCallback implements
org.skife.csv.ReaderCallback {
- public int count = 0;
+ public int count;
@Override
public void onRow(final String[] fields) {
diff --git a/src/test/java/org/apache/commons/csv/PerformanceTest.java
b/src/test/java/org/apache/commons/csv/PerformanceTest.java
index 10381a6..a9dcca0 100644
--- a/src/test/java/org/apache/commons/csv/PerformanceTest.java
+++ b/src/test/java/org/apache/commons/csv/PerformanceTest.java
@@ -63,7 +63,7 @@ public class PerformanceTest {
private static int max = 11; // skip first test
- private static int num = 0; // number of elapsed times recorded
+ private static int num; // number of elapsed times recorded
private static final long[] ELAPSED_TIMES = new long[max];
private static final CSVFormat format = CSVFormat.EXCEL;
@@ -91,9 +91,7 @@ public class PerformanceTest {
final String[] tests;
if (argc > 1) {
tests = new String[argc - 1];
- for (int i = 1; i < argc; i++) {
- tests[i - 1] = args[i];
- }
+ System.arraycopy(args, 1, tests, 0, argc - 1);
} else {
tests = new String[] { "file", "split", "extb", "exts", "csv",
"csv-path", "csv-path-db", "csv-url", "lexreset", "lexnew" };
}