Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TextEquals() [2/2]

bool System.Text.Json.JsonDocument.TextEquals ( int index,
ReadOnlySpan< char > otherText,
bool isPropertyName )
inlinepackage

Definition at line 489 of file JsonDocument.cs.

490 {
492 int num = (isPropertyName ? (index - 12) : index);
494 if (num2 == num)
495 {
496 return otherText.SequenceEqual(text.AsSpan());
497 }
498 byte[] array = null;
499 int num3 = checked(otherText.Length * 3);
500 Span<byte> span = ((num3 > 256) ? ((Span<byte>)(array = ArrayPool<byte>.Shared.Rent(num3))) : stackalloc byte[256]);
501 Span<byte> utf8Destination = span;
502 ReadOnlySpan<byte> utf16Source = MemoryMarshal.AsBytes(otherText);
503 int bytesConsumed;
504 int bytesWritten;
507 if (array != null)
508 {
509 utf8Destination.Slice(0, bytesWritten).Clear();
511 }
512 return result;
513 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
bool TextEquals(int index, ReadOnlySpan< char > otherText, bool isPropertyName)

References System.Text.Json.JsonDocument._lastIndexAndString, System.array, System.Text.Json.JsonDocument.CheckNotDisposed(), System.Text.Json.Dictionary, System.index, System.Buffers.ArrayPool< T >.Shared, System.text, System.Text.Json.JsonDocument.TextEquals(), and System.Text.Json.JsonWriterHelper.ToUtf8().

Referenced by System.Text.Json.JsonDocument.TextEquals(), System.Text.Json.JsonElement.TextEqualsHelper(), and System.Text.Json.JsonElement.TextEqualsHelper().