From 15cc402980996a091030a82dc085b9747aa07d8b Mon Sep 17 00:00:00 2001 From: Ahson Khan Date: Wed, 26 Jun 2019 11:59:32 -0700 Subject: [PATCH] Do not pass ReadOnlySequence by "in" to the Utf8JsonReader. (dotnet/corefx#38930) * Do not pass ReadOnlySequence by "in" to the Utf8JsonReader. * Remove in from the new ctor as well. Commit migrated from https://github.com/dotnet/corefx/commit/563bbef3ed9c7029238ae9dbaf61129deee3c53f --- src/libraries/System.Text.Json/ref/System.Text.Json.cs | 4 ++-- .../System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Text.Json/ref/System.Text.Json.cs b/src/libraries/System.Text.Json/ref/System.Text.Json.cs index 3781b73975561..886cc19380602 100644 --- a/src/libraries/System.Text.Json/ref/System.Text.Json.cs +++ b/src/libraries/System.Text.Json/ref/System.Text.Json.cs @@ -254,8 +254,8 @@ public ref partial struct Utf8JsonReader { private object _dummy; private int _dummyPrimitive; - public Utf8JsonReader(in System.Buffers.ReadOnlySequence jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state) { throw null; } - public Utf8JsonReader(in System.Buffers.ReadOnlySequence jsonData, System.Text.Json.JsonReaderOptions options = default(System.Text.Json.JsonReaderOptions)) { throw null; } + public Utf8JsonReader(System.Buffers.ReadOnlySequence jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state) { throw null; } + public Utf8JsonReader(System.Buffers.ReadOnlySequence jsonData, System.Text.Json.JsonReaderOptions options = default(System.Text.Json.JsonReaderOptions)) { throw null; } public Utf8JsonReader(System.ReadOnlySpan jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state) { throw null; } public Utf8JsonReader(System.ReadOnlySpan jsonData, System.Text.Json.JsonReaderOptions options = default(System.Text.Json.JsonReaderOptions)) { throw null; } public long BytesConsumed { get { throw null; } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs index 04d09f4dddd89..b1fb2b8c9b76e 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs @@ -22,7 +22,7 @@ public ref partial struct Utf8JsonReader /// Since this type is a ref struct, it is a stack-only type and all the limitations of ref structs apply to it. /// This is the reason why the ctor accepts a . /// - public Utf8JsonReader(in ReadOnlySequence jsonData, bool isFinalBlock, JsonReaderState state) + public Utf8JsonReader(ReadOnlySequence jsonData, bool isFinalBlock, JsonReaderState state) { _buffer = jsonData.First.Span; @@ -104,7 +104,7 @@ public Utf8JsonReader(in ReadOnlySequence jsonData, bool isFinalBlock, Jso /// This assumes that the entire JSON payload is passed in (equivalent to = true) /// /// - public Utf8JsonReader(in ReadOnlySequence jsonData, JsonReaderOptions options = default) + public Utf8JsonReader(ReadOnlySequence jsonData, JsonReaderOptions options = default) : this(jsonData, isFinalBlock: true, new JsonReaderState(options)) { }