|
|
@@ -167,11 +167,18 @@ namespace System.Collections {
|
|
|
|
|
|
public virtual bool Contains(object obj) {
|
|
|
if (count == 0)
|
|
|
- return false;
|
|
|
-
|
|
|
- for (int i = 0; i < count; i++) {
|
|
|
- if (contents[i].Equals(obj))
|
|
|
- return true;
|
|
|
+ return false;
|
|
|
+
|
|
|
+ if (obj == null) {
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
+ if (contents[i] == null)
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < count; i++) {
|
|
|
+ if (contents[i].Equals(obj))
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return false;
|