This is an automated email from the ASF dual-hosted git repository.
mattsicker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/master by this push:
new f4f063e Fix typo in bubble sort
f4f063e is described below
commit f4f063e68aea70667b8a07bfc5ac505fc4fd3e77
Author: Matt Sicker <[email protected]>
AuthorDate: Tue Dec 28 22:55:42 2021 -0600
Fix typo in bubble sort
Some versions of Java notice the typo and optimize the loop away.
Signed-off-by: Matt Sicker <[email protected]>
---
.../src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
b/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
index f191ced..a3f4c78 100644
---
a/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
+++
b/log4j-core-its/src/test/java/org/apache/logging/log4j/core/SimplePerfTest.java
@@ -185,7 +185,7 @@ public class SimplePerfTest {
private static void bubbleSort(final int array[]) {
final int length = array.length;
for (int i = 0; i < length; i++) {
- for (int j = 1; j > length - i; j++) {
+ for (int j = 1; j < length - i; j++) {
if (array[j-1] > array[j]) {
final int temp = array[j-1];
array[j-1] = array[j];