BAEL-7408: Added braces (#15552)
This commit is contained in:
parent
906faa4fa6
commit
6114e0534f
@ -29,8 +29,9 @@ public class SinglyLinkedList<S> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void remove(S element) {
|
public void remove(S element) {
|
||||||
if (isEmpty())
|
if (isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Node<S> previous = null;
|
Node<S> previous = null;
|
||||||
Node<S> current = head;
|
Node<S> current = head;
|
||||||
@ -54,10 +55,9 @@ public class SinglyLinkedList<S> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removeLast() {
|
public void removeLast() {
|
||||||
if (isEmpty())
|
if (isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
} else if (size() == 1) {
|
||||||
if (size() == 1) {
|
|
||||||
tail = null;
|
tail = null;
|
||||||
head = null;
|
head = null;
|
||||||
} else {
|
} else {
|
||||||
@ -73,8 +73,9 @@ public class SinglyLinkedList<S> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(S element) {
|
public boolean contains(S element) {
|
||||||
if (isEmpty())
|
if (isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Node<S> current = head;
|
Node<S> current = head;
|
||||||
while (current != null) {
|
while (current != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user