Skip to content

Commit

Permalink
Ensure cached JsonElement instances are always cloned
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Oct 3, 2020
1 parent 66c0855 commit 92c4848
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return builder.ToImmutable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return new ValueTask<ImmutableDictionary<string, JsonElement>>(builder.ToImmutable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return new ValueTask<ImmutableDictionary<string, JsonElement>>(builder.ToImmutable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return new ValueTask<ImmutableDictionary<string, JsonElement>>(builder.ToImmutable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetProperties

foreach (var property in document.RootElement.EnumerateObject())
{
builder[property.Name] = property.Value;
builder[property.Name] = property.Value.Clone();
}

return new ValueTask<ImmutableDictionary<string, JsonElement>>(builder.ToImmutable());
Expand Down

0 comments on commit 92c4848

Please sign in to comment.