* ColumnHeader.cs: Remove the double linear search in the Index
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ColumnHeader.cs
index ee3ccfd0b431a88519913cff901b5d0af2f6574a..5b7f9ea8b6bf4ac48b0dbde2417b71a1f8bce7c0 100644 (file)
@@ -265,10 +265,9 @@ namespace System.Windows.Forms
                [Browsable (false)]
                public int Index {
                        get {
-                               if (owner != null && owner.Columns != null
-                                   && owner.Columns.Contains (this)) {
+                               if (owner != null)
                                        return owner.Columns.IndexOf (this);
-                               }
+
                                return -1;
                        }
                }