hi. don't dare to commit, it's been such a long time :P could somebody please review this patch? could not find the mail address of Ricardo FernÃndez Pascual.
fixes the following test case: 1. construct queue with an ICollection of size 1 2. dequeue the item 3. enqueue another item -> *array index exception* the problem is that the icollection constructor fails to recalculate the tail pointer correctly. besides: System.Collections.Queue grows by a realloc-style approach with arrays. i believe the internal structure could/should be an arraylist. would such a patch be accepted? regards, daniel -- Daniel Stodden LRR - Lehrstuhl fÃr Rechnertechnik und Rechnerorganisation Institut fÃr Informatik der TU Muenchen D-85748 Garching http://wwwbode.in.tum.de/~stodden mailto:[EMAIL PROTECTED] --
Index: Queue.cs
===================================================================
RCS file: /cvs/public/mcs/class/corlib/System.Collections/Queue.cs,v
retrieving revision 1.21
diff -u -r1.21 Queue.cs
--- Queue.cs 11 Jun 2004 01:59:36 -0000 1.21
+++ Queue.cs 11 Jul 2004 22:15:13 -0000
@@ -53,7 +53,7 @@
throw new ArgumentNullException ("col");
_size = _array.Length;
- _tail = _size;
+ _tail = _size % _array.Length;
col.CopyTo (_array, 0);
}
signature.asc
Description: This is a digitally signed message part
