mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-10 02:35:42 +00:00
Call ZString.CreateUtf8StringBuilder
Don't instantiate directly, let ZString handle it
This commit is contained in:
parent
99bda9d53f
commit
554d326819
@ -270,8 +270,8 @@ public sealed class VirtualParadiseParticleEmitterObject : VirtualParadiseObject
|
||||
Span<char> text = stackalloc char[data.Length];
|
||||
Encoding.UTF8.GetChars(data, text);
|
||||
|
||||
using var keyBuffer = new Utf8ValueStringBuilder(false);
|
||||
using var valueBuffer = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder keyBuffer = ZString.CreateUtf8StringBuilder();
|
||||
using Utf8ValueStringBuilder valueBuffer = ZString.CreateUtf8StringBuilder();
|
||||
var isKey = true;
|
||||
|
||||
for (var index = 0; index < text.Length; index++)
|
||||
|
@ -45,7 +45,7 @@ public sealed class VirtualParadisePathObject : VirtualParadiseObject
|
||||
Span<char> chars = stackalloc char[data.Length];
|
||||
Encoding.UTF8.GetChars(data, chars);
|
||||
|
||||
using var buffer = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder buffer = ZString.CreateUtf8StringBuilder();
|
||||
int index;
|
||||
|
||||
// version
|
||||
|
@ -62,7 +62,7 @@ internal static class SpanExtensions
|
||||
float y = 0;
|
||||
byte spaceCount = 0;
|
||||
|
||||
using var buffer = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder buffer = ZString.CreateUtf8StringBuilder();
|
||||
for (var index = 0; index < value.Length; index++)
|
||||
{
|
||||
char current = value[index];
|
||||
@ -107,7 +107,7 @@ internal static class SpanExtensions
|
||||
float z = 0;
|
||||
byte spaceCount = 0;
|
||||
|
||||
using var buffer = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder buffer = ZString.CreateUtf8StringBuilder();
|
||||
for (var index = 0; index < value.Length; index++)
|
||||
{
|
||||
char current = value[index];
|
||||
@ -155,7 +155,7 @@ internal static class SpanExtensions
|
||||
double z = 0;
|
||||
byte spaceCount = 0;
|
||||
|
||||
using var buffer = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder buffer = ZString.CreateUtf8StringBuilder();
|
||||
for (var index = 0; index < value.Length; index++)
|
||||
{
|
||||
char current = value[index];
|
||||
@ -204,7 +204,7 @@ internal static class SpanExtensions
|
||||
float w = 0;
|
||||
byte spaceCount = 0;
|
||||
|
||||
using var buffer = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder buffer = ZString.CreateUtf8StringBuilder();
|
||||
for (var index = 0; index < value.Length; index++)
|
||||
{
|
||||
char current = value[index];
|
||||
|
@ -10,7 +10,7 @@ internal sealed class IntToBoolConverter : ValueConverter<bool>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out bool result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
int read;
|
||||
while ((read = reader.Read()) != -1)
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ internal sealed class MillisecondToTimeSpanConverter : ValueConverter<TimeSpan>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out TimeSpan result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
int read;
|
||||
while ((read = reader.Read()) != -1)
|
||||
{
|
||||
|
@ -11,7 +11,7 @@ internal sealed class Vector2Converter : ValueConverter<Vector2>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out Vector2 result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
var spaceCount = 0;
|
||||
|
||||
while (true)
|
||||
|
@ -11,7 +11,7 @@ internal sealed class Vector3Converter : ValueConverter<Vector3>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out Vector3 result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
var spaceCount = 0;
|
||||
|
||||
while (true)
|
||||
|
@ -10,7 +10,7 @@ internal sealed class Vector3ToColorConverter : ValueConverter<ColorF>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out ColorF result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
var spaceCount = 0;
|
||||
|
||||
while (true)
|
||||
|
@ -10,7 +10,7 @@ internal sealed class Vector3dConverter : ValueConverter<Vector3d>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out Vector3d result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
var spaceCount = 0;
|
||||
|
||||
while (true)
|
||||
|
@ -10,7 +10,7 @@ internal sealed class Vector4ToColorConverter : ValueConverter<ColorF>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out ColorF result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
var spaceCount = 0;
|
||||
|
||||
while (true)
|
||||
|
@ -11,7 +11,7 @@ internal sealed class Vector4ToVector3Converter : ValueConverter<Vector3>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out Vector3 result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
var spaceCount = 0;
|
||||
|
||||
while (true)
|
||||
|
@ -18,7 +18,7 @@ internal sealed class VectorToNthComponentConverter : ValueConverter<float>
|
||||
/// <inheritdoc />
|
||||
public override void Deserialize(TextReader reader, out float result)
|
||||
{
|
||||
using var builder = new Utf8ValueStringBuilder(false);
|
||||
using Utf8ValueStringBuilder builder = ZString.CreateUtf8StringBuilder();
|
||||
var spaceCount = 0;
|
||||
|
||||
while (true)
|
||||
|
Loading…
Reference in New Issue
Block a user