Commit 61dfbd25 authored by bryce's avatar bryce
Browse files

From Adam Welc <welc@cs.purdue.edu>:

	* java/util/LinkedList.java (removeFirst): Update `first' field.
	Handle the last == first case.
	(removeLast): Update `last' field. Handle the last == first case.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37940 138bc75d-0d04-0410-961f-82ee72b054a4
parent ec0eee8d
......@@ -5,6 +5,11 @@
* java/lang/dtoa.c: Include string.h.
* java/lang/natString.cc (toLowerCase): Initialize `ch' to prevent
compiler warning.
From Adam Welc <welc@cs.purdue.edu>:
* java/util/LinkedList.java (removeFirst): Update `first' field.
Handle the last == first case.
(removeLast): Update `last' field. Handle the last == first case.
2000-12-01 Warren Levy <warrenl@cygnus.com>
......
......@@ -183,6 +183,11 @@ public class LinkedList extends AbstractSequentialList
if (first.next != null)
first.next.previous = null;
else
last = null;
first = first.next;
return r;
}
......@@ -195,7 +200,12 @@ public class LinkedList extends AbstractSequentialList
Object r = last.data;
if (last.previous != null)
last.previous.next = null;
last.previous.next = null;
else
first = null;
last = last.previous;
return r;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment