Fix subtle bug in new string.Join implementation. (dotnet/coreclr#8310)
authorJames Ko <jamesqko@gmail.com>
Fri, 25 Nov 2016 19:28:15 +0000 (14:28 -0500)
committerJan Kotas <jkotas@microsoft.com>
Fri, 25 Nov 2016 19:28:15 +0000 (11:28 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/dcadfbeecd96483f7ae0ba02b597bcf38f86f304

src/coreclr/src/mscorlib/src/System/String.Manipulation.cs

index c5af655..e1bf4be 100644 (file)
@@ -845,7 +845,9 @@ namespace System
             // something changed concurrently to mutate the input array: fall back to
             // doing the concatenation again, but this time with a defensive copy. This
             // fall back should be extremely rare.
-            return copiedLength == totalLength ? result : Concat((string[])value.Clone());
+            return copiedLength == totalLength ?
+                result :
+                JoinCore(separator, separatorLength, (string[])value.Clone(), startIndex, count);
         }
         
         //