[Mono-list] [patch] Queue.cs

Daniel Stodden stodden@in.tum.de
Mon, 12 Jul 2004 01:20:50 +0200


--=-4j6SKEUiO1XCbSPiBXdq
Content-Type: multipart/mixed; boundary="=-SUgX1ZbZjJ0LQtWsTrEF"


--=-SUgX1ZbZjJ0LQtWsTrEF
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


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=C3=A1ndez 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

--=20
Daniel Stodden
LRR   -   Lehrstuhl f=C3=BCr Rechnertechnik und Rechnerorganisation
Institut f=C3=BCr Informatik der TU Muenchen       D-85748 Garching
http://wwwbode.in.tum.de/~stodden     mailto:stodden@in.tum.de
                                                            --

--=-SUgX1ZbZjJ0LQtWsTrEF
Content-Disposition: attachment; filename=queue.diff
Content-Type: text/x-patch; name=queue.diff; charset=UTF-8
Content-Transfer-Encoding: base64

SW5kZXg6IFF1ZXVlLmNzDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1MgZmlsZTogL2N2cy9wdWJsaWMvbWNzL2Ns
YXNzL2NvcmxpYi9TeXN0ZW0uQ29sbGVjdGlvbnMvUXVldWUuY3Msdg0KcmV0cmlldmluZyByZXZp
c2lvbiAxLjIxDQpkaWZmIC11IC1yMS4yMSBRdWV1ZS5jcw0KLS0tIFF1ZXVlLmNzCTExIEp1biAy
MDA0IDAxOjU5OjM2IC0wMDAwCTEuMjENCisrKyBRdWV1ZS5jcwkxMSBKdWwgMjAwNCAyMjoxNTox
MyAtMDAwMA0KQEAgLTUzLDcgKzUzLDcgQEANCiAJCQkJdGhyb3cgbmV3IEFyZ3VtZW50TnVsbEV4
Y2VwdGlvbiAoImNvbCIpOw0KIAkJCQ0KIAkJCV9zaXplID0gX2FycmF5Lkxlbmd0aDsNCi0JCQlf
dGFpbCA9IF9zaXplOw0KKwkJCV90YWlsID0gX3NpemUgJSBfYXJyYXkuTGVuZ3RoOw0KIAkJCWNv
bC5Db3B5VG8gKF9hcnJheSwgMCk7DQogCQl9DQogCQkJDQo=

--=-SUgX1ZbZjJ0LQtWsTrEF--

--=-4j6SKEUiO1XCbSPiBXdq
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBA8ctRRX6CrrDYc1sRAjjOAJ4x5Z0FU1ach+X8gcdwFYMDv3fA6QCffonu
sUI/A8hEbJHZb4T+lbgMgXI=
=uOPx
-----END PGP SIGNATURE-----

--=-4j6SKEUiO1XCbSPiBXdq--