Skip to content

Commit 0f4e81e

Browse files
committed
Fixed the review comments
1 parent d6f9b92 commit 0f4e81e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

data-structures/src/main/java/com/baeldung/list/CircularLinkedList.java renamed to data-structures/src/main/java/com/baeldung/circularlinkedlist/CircularLinkedList.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung.list;
1+
package com.baeldung.circularlinkedlist;
22

33
import org.slf4j.Logger;
44
import org.slf4j.LoggerFactory;
@@ -49,13 +49,11 @@ public void deleteNode(int valueToDelete) {
4949
if (currentNode.value == valueToDelete) {
5050
head = head.nextNode;
5151
tail.nextNode = head;
52-
currentNode = null;
5352
} else {
5453
do {
5554
Node nextNode = currentNode.nextNode;
5655
if (nextNode.value == valueToDelete) {
5756
currentNode.nextNode = nextNode.nextNode;
58-
nextNode = null;
5957
break;
6058
}
6159
currentNode = currentNode.nextNode;

data-structures/src/test/java/com/baeldung/list/CircularLinkedListUnitTest.java renamed to data-structures/src/test/java/com/baeldung/circularlinkedlist/CircularLinkedListUnitTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
package com.baeldung.list;
1+
package com.baeldung.circularlinkedlist;
22

33
import static org.junit.Assert.assertFalse;
44
import static org.junit.Assert.assertTrue;
55

66
import org.junit.Test;
77

8+
import com.baeldung.circularlinkedlist.CircularLinkedList;
9+
810
public class CircularLinkedListUnitTest {
911

1012
@Test

0 commit comments

Comments
 (0)