From 65f71fd8191eeb5dbbe149d23dc108940a2613e9 Mon Sep 17 00:00:00 2001 From: Petr Onderka Date: Thu, 25 Oct 2018 18:21:41 +0200 Subject: [PATCH] Avoid comparing capacity in StringBuilder.Equals (dotnet/coreclr#20567) * 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 | 14 ++++++++++++++ .../src/System/Text/StringBuilder.cs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/coreclr/tests/CoreFX/CoreFX.issues.json b/src/coreclr/tests/CoreFX/CoreFX.issues.json index e973d5b..b038176 100644 --- a/src/coreclr/tests/CoreFX/CoreFX.issues.json +++ b/src/coreclr/tests/CoreFX/CoreFX.issues.json @@ -579,5 +579,19 @@ ], "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." + } + ] + } } ] diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs index 99021e2..2e1b067 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs @@ -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; -- 2.7.4