Avoid comparing capacity in StringBuilder.Equals (dotnet/coreclr#20567)
authorPetr Onderka <gsvick@gmail.com>
Thu, 25 Oct 2018 16:21:41 +0000 (18:21 +0200)
committerJan Kotas <jkotas@microsoft.com>
Thu, 25 Oct 2018 16:21:41 +0000 (09:21 -0700)
* Avoid comparing capacity in StringBuilder.Equals

* Disabled corefx StringBuilder test

Commit migrated from https://github.com/dotnet/coreclr/commit/2e84928f84debcca03226e613fc84668c18bd261

src/coreclr/tests/CoreFX/CoreFX.issues.json
src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

index e973d5b..b038176 100644 (file)
             ],
             "methods": null
         }
+    },
+    {
+        "name": "System.Runtime.Tests",
+        "enabled": true,
+        "exclusions": {
+            "namespaces": null,
+            "classes": null,
+            "methods": [
+                {
+                    "name": "System.Text.Tests.StringBuilderTests.Equals",
+                    "reason": "Because of a change in StringBuilder, this test is outdated."
+                }
+            ]
+        }
     }
 ]
index 99021e2..2e1b067 100644 (file)
@@ -1777,7 +1777,7 @@ namespace System.Text
         {
             if (sb == null)
                 return false;
-            if (Capacity != sb.Capacity || MaxCapacity != sb.MaxCapacity || Length != sb.Length)
+            if (Length != sb.Length)
                 return false;
             if (sb == this)
                 return true;