Skip to content

Commit

Permalink
Fix NamespaceCache usage in System.Private.Xml.Linq (#101158)
Browse files Browse the repository at this point in the history
It's intended to be mutated on Get so that it can cache the XNamespace object - the fields being marked readonly completely block all caching.

Co-authored-by: Stephen Toub <stoub@microsoft.com>
  • Loading branch information
hamarb123 and stephentoub authored Jul 22, 2024
1 parent f3ee529 commit 4555974
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,8 @@ internal async Task ReadContentFromAsync(XmlReader r, LoadOptions o, Cancellatio

private sealed class ContentReader
{
private readonly NamespaceCache _eCache;
private readonly NamespaceCache _aCache;
private NamespaceCache _eCache;
private NamespaceCache _aCache;
private readonly IXmlLineInfo? _lineInfo;
private XContainer _currentContainer;
private string? _baseUri;
Expand Down

0 comments on commit 4555974

Please sign in to comment.