Formatting cleanup

This commit is contained in:
Ziver Koc 2021-03-23 21:49:52 +01:00
parent 65b47d0755
commit ec1758ce20
222 changed files with 2739 additions and 2726 deletions

View file

@ -40,7 +40,7 @@ public class AnonymousFunctionBenchmark {
@Test
public void functionLoop() {
for(int k=0; k<TEST_EXECUTIONS; k++) {
for (int k=0; k<TEST_EXECUTIONS; k++) {
for (int i = 0; i < array.length; i++) {
array[i] = new CalcFunc(){
public int calc(int i){
@ -59,7 +59,7 @@ public class AnonymousFunctionBenchmark {
}
};
for(int k=0; k<TEST_EXECUTIONS; k++) {
for (int k=0; k<TEST_EXECUTIONS; k++) {
for (int i = 0; i < array.length; i++) {
array[i] = func.calc(i);
}
@ -68,7 +68,7 @@ public class AnonymousFunctionBenchmark {
@Test
public void rawLoops(){
for(int k=0; k<TEST_EXECUTIONS; k++) {
for (int k=0; k<TEST_EXECUTIONS; k++) {
for (int i = 0; i < array.length; i++) {
array[i] = i;
}

View file

@ -41,7 +41,7 @@ public class LoopBenchmark {
@Test
public void writeArrayOneLoop() {
for(int k=0; k<TEST_EXECUTIONS; k++) {
for (int k=0; k<TEST_EXECUTIONS; k++) {
for (int i = 0; i < Math.max(array1.length, array1.length); i++) {
if (i < array1.length)
array1[i] = i;
@ -53,7 +53,7 @@ public class LoopBenchmark {
@Test
public void writeArraySeparateLoops(){
for(int k=0; k<TEST_EXECUTIONS; k++) {
for (int k=0; k<TEST_EXECUTIONS; k++) {
for (int i = 0; i < array1.length; i++) {
array1[i] = i;
}
@ -67,7 +67,7 @@ public class LoopBenchmark {
@Test
public void readArrayLoop() {
int sum = 0;
for(int k=0; k<TEST_EXECUTIONS; k++) {
for (int k=0; k<TEST_EXECUTIONS; k++) {
for (int i = 0; i < array1.length; i++) {
sum += array1[i];
}
@ -77,7 +77,7 @@ public class LoopBenchmark {
@Test
public void readArrayForeach() {
int sum = 0;
for(int k=0; k<TEST_EXECUTIONS; k++) {
for (int k=0; k<TEST_EXECUTIONS; k++) {
for (int i : array1) {
sum += array1[i];
}

View file

@ -49,20 +49,20 @@ public class StringSplitBenchmark {
@Test
public void stringSplit(){
for(int i=0; i<TEST_EXECUTIONS; i++)
for (int i=0; i<TEST_EXECUTIONS; i++)
assertSplit(str.split(delimiter));
}
public static Pattern pattern = Pattern.compile(delimiter);
@Test
public void patternSplit(){
for(int i=0; i<TEST_EXECUTIONS; i++)
for (int i=0; i<TEST_EXECUTIONS; i++)
assertSplit(pattern.split(str));
}
@Test
public void substring(){
for(int i=0; i<TEST_EXECUTIONS; i++) {
for (int i=0; i<TEST_EXECUTIONS; i++) {
List<String> splitList = StringUtil.split(str, delimiter.charAt(0));
assertSplit(splitList.toArray(new String[0]));
}