Fix null sessions in HttpContextWrapper.Session
[mono.git] / mcs / class / corlib / System.Collections / Queue.cs
index ae99d9aa6d5cd900683cd8da178049bdb6cbb508..5e359e821f4d5f1bf85e94360afa20587d2f0422 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // System.Collections.Queue
 //
 // Author:
@@ -36,11 +36,16 @@ using System.Runtime.InteropServices;
 
 namespace System.Collections {
 
-#if NET_2_0
        [ComVisible(true)]
-#endif
+       [System.Diagnostics.DebuggerDisplay ("Count={Count}")]
+       [System.Diagnostics.DebuggerTypeProxy (typeof (CollectionDebuggerView))]
        [Serializable]
-       public class Queue : ICollection, IEnumerable, ICloneable {
+#if INSIDE_CORLIB
+       public
+#else
+       internal
+#endif
+       class Queue : ICollection, IEnumerable, ICloneable {
 
                private object[] _array;
                private int _head = 0;   // points to the first used slot
@@ -50,7 +55,9 @@ namespace System.Collections {
                private int _version = 0;
 
                public Queue () : this (32, 2.0F) {}
-               public Queue (int initialCapacity) : this (initialCapacity, 2.0F) {}
+
+               public Queue (int capacity) : this (capacity, 2.0F) {}
+
                public Queue(ICollection col) : this (col == null ? 32 : col.Count)
                {
                        if (col == null)
@@ -63,13 +70,13 @@ namespace System.Collections {
                                Enqueue (o);    
                }
                        
-               public Queue (int initialCapacity, float growFactor) {
-                       if (initialCapacity < 0)
+               public Queue (int capacity, float growFactor) {
+                       if (capacity < 0)
                                throw new ArgumentOutOfRangeException("capacity", "Needs a non-negative number");
                        if (!(growFactor >= 1.0F && growFactor <= 10.0F))
                                throw new ArgumentOutOfRangeException("growFactor", "Queue growth factor must be between 1.0 and 10.0, inclusive");
            
-                       _array = new object[initialCapacity];
+                       _array = new object[capacity];
 
                        this._growFactor = (int)(growFactor * 100);
                }
@@ -207,7 +214,7 @@ namespace System.Collections {
                        CopyTo (trimmed, 0);
                        _array = trimmed;
                        _head = 0;
-                       _tail = _head + _size;
+                       _tail = 0;
                }
 
                // private methods