Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private static <T> boolean compareLists(java.util.LinkedList<T> list1, list.Link
if(!it1.next().equals(it2.value())) return false;
it2.moveForward();
}
if(it2.isPastEnd() && it1.hasNext()) return false;

//check backwards
it1 = list1.descendingIterator();
Expand All @@ -33,6 +34,8 @@ private static <T> boolean compareLists(java.util.LinkedList<T> list1, list.Link
if(!it1.next().equals(it2.value())) return false;
it2.moveBackward();
}
if(it2.isPastBeginning() && it1.hasNext()) return false;

return true;
}

Expand Down