New test.
[mono.git] / mcs / class / System / System.CodeDom / CodeExpressionCollection.cs
index 9a03cebe0cc0c2f5e34001d295ea51e281236e94..7a1f19f60ab85f5655f87c74c154baa39c1ab146 100644 (file)
@@ -94,7 +94,8 @@ namespace System.CodeDom
                                throw new ArgumentNullException ("value");
                        }
 
-                       for (int i = 0; i < value.Count; i++) {
+                       int count = value.Count;
+                       for (int i = 0; i < count; i++) {
                                Add (value[i]);
                        }
                }
@@ -121,10 +122,7 @@ namespace System.CodeDom
 
                public void Remove( CodeExpression value )
                {
-                       int index = IndexOf( value );
-                       if ( index < 0 )
-                               throw( new ArgumentException( "The specified object is not found in the collection" ) );
-                       RemoveAt( index );
+                       List.Remove (value);
                }
        }
 }