Updated the previous variable in loop (#7205)
This commit is contained in:
parent
2235c2e780
commit
a14dc0d889
@ -27,6 +27,7 @@ public class SortedListChecker {
|
|||||||
if (previous.compareTo(current) > 0) {
|
if (previous.compareTo(current) > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
previous = current;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -43,6 +44,7 @@ public class SortedListChecker {
|
|||||||
if (employeeComparator.compare(previous, current) > 0) {
|
if (employeeComparator.compare(previous, current) > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
previous = current;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user