Skip to content

Commit 80064a6

Browse files
committed
Do not clone the XmlWriterSettings
The XML writer settings are created when building the `Log4NetTextFormatterOptions` instance and can't be altered after that through the public API.
1 parent 4feaa9e commit 80064a6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Log4NetTextFormatterOptions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ internal Log4NetTextFormatterOptions(IFormatProvider? formatProvider, CDataMode
1313
FormatProvider = formatProvider;
1414
CDataMode = cDataMode;
1515
Log4NetXmlNamespace = log4NetXmlNamespace;
16-
// ReSharper disable once ConstantConditionalAccessQualifier
17-
XmlWriterSettings = xmlWriterSettings?.Clone() ?? throw new ArgumentNullException(nameof(xmlWriterSettings));
16+
XmlWriterSettings = xmlWriterSettings ?? throw new ArgumentNullException(nameof(xmlWriterSettings));
1817
FilterProperty = filterProperty ?? throw new ArgumentNullException(nameof(filterProperty));
1918
FormatException = formatException ?? throw new ArgumentNullException(nameof(formatException));
2019
}

0 commit comments

Comments
 (0)