Cysharp/ZString

ZString.Join() not thread safe?

Opened this issue · 2 comments

It seems that concurrent calling of ZString.Join() Fails.

Call stacks:

System.ArgumentException: Can't format argument. (Parameter 'value')
at Cysharp.Text.Utf8ValueStringBuilder.ThrowArgumentException(String paramName)
at Cysharp.Text.Utf8ValueStringBuilder.Append[T](T value)
at Cysharp.Text.ZString.Join[T](String separator, T[] values)

Thank you, ZString.Join is thread-safe.
However, there was a bug in the stretching process.
The following code will reproduce it.

var a = new string('a', 30000);
var b = new string('b', 1000000);
ZString.Join(',', new string[] { a, b });

I'll fix soon.

I've upload 2.1.0, please try it.