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

◆ UnescapeAndCompare() [2/2]

static bool System.Text.Json.JsonReaderHelper.UnescapeAndCompare ( ReadOnlySpan< byte > utf8Source,
ReadOnlySpan< byte > other )
inlinestatic

Definition at line 365 of file JsonReaderHelper.cs.

366 {
367 byte[] array = null;
368 Span<byte> span = ((utf8Source.Length > 256) ? ((Span<byte>)(array = ArrayPool<byte>.Shared.Rent(utf8Source.Length))) : stackalloc byte[256]);
369 Span<byte> span2 = span;
371 span2 = span2.Slice(0, written);
372 bool result = other.SequenceEqual(span2);
373 if (array != null)
374 {
375 span2.Clear();
377 }
378 return result;
379 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7

References System.array, System.Text.Json.Dictionary, System.other, System.Buffers.ArrayPool< T >.Shared, and System.Unescape.

Referenced by System.Text.Json.JsonDocument.TextEquals(), System.Text.Json.Utf8JsonReader.UnescapeAndCompare(), and System.Text.Json.Utf8JsonReader.UnescapeSequenceAndCompare().