diff --git a/XmppSharp/Dom/Element.cs b/XmppSharp/Dom/Element.cs index 245089e..bdddb39 100644 --- a/XmppSharp/Dom/Element.cs +++ b/XmppSharp/Dom/Element.cs @@ -1,7 +1,5 @@ using System.Globalization; -using System.Security; using System.Text; -using System.Web; using System.Xml; using XmppSharp.Factory; @@ -223,7 +221,6 @@ internal void WriteToInternal(XmlWriter writer, in XmlFormatting formatting, boo if (includeChildren) { - lock (this._childNodes) { foreach (var node in this._childNodes) diff --git a/XmppSharp/Parsers/XmppStreamParser.cs b/XmppSharp/Parsers/XmppStreamParser.cs index 06de00d..2b98327 100644 --- a/XmppSharp/Parsers/XmppStreamParser.cs +++ b/XmppSharp/Parsers/XmppStreamParser.cs @@ -1,6 +1,4 @@ -using System.Runtime.CompilerServices; -using System.Text; -using System.Xml; +using System.Xml; using System.Xml.Schema; using XmppSharp.Exceptions; using XmppSharp.Factory; diff --git a/XmppSharp/Protocol/Sasl/Abort.cs b/XmppSharp/Protocol/Sasl/Abort.cs index 3852f4d..12109cb 100644 --- a/XmppSharp/Protocol/Sasl/Abort.cs +++ b/XmppSharp/Protocol/Sasl/Abort.cs @@ -1,5 +1,4 @@ -using System.Xml.Linq; -using XmppSharp.Attributes; +using XmppSharp.Attributes; namespace XmppSharp.Protocol.Sasl; diff --git a/XmppSharp/Protocol/Sasl/Challenge.cs b/XmppSharp/Protocol/Sasl/Challenge.cs index 661191c..c41b1ac 100644 --- a/XmppSharp/Protocol/Sasl/Challenge.cs +++ b/XmppSharp/Protocol/Sasl/Challenge.cs @@ -1,5 +1,4 @@ -using System.Xml.Linq; -using XmppSharp.Attributes; +using XmppSharp.Attributes; namespace XmppSharp.Protocol.Sasl; diff --git a/XmppSharp/Protocol/Sasl/Failure.cs b/XmppSharp/Protocol/Sasl/Failure.cs index 8f1e14b..47af554 100644 --- a/XmppSharp/Protocol/Sasl/Failure.cs +++ b/XmppSharp/Protocol/Sasl/Failure.cs @@ -1,5 +1,4 @@ -using System.Xml.Linq; -using XmppSharp.Attributes; +using XmppSharp.Attributes; namespace XmppSharp.Protocol.Sasl; diff --git a/XmppSharp/Protocol/Sasl/Mechanism.cs b/XmppSharp/Protocol/Sasl/Mechanism.cs index e251ce0..85f1e2e 100644 --- a/XmppSharp/Protocol/Sasl/Mechanism.cs +++ b/XmppSharp/Protocol/Sasl/Mechanism.cs @@ -1,5 +1,4 @@ -using System.Xml.Linq; -using XmppSharp.Attributes; +using XmppSharp.Attributes; namespace XmppSharp.Protocol.Sasl; diff --git a/XmppSharp/TryParseHelpers.cs b/XmppSharp/TryParseHelpers.cs index 4148538..930b166 100644 --- a/XmppSharp/TryParseHelpers.cs +++ b/XmppSharp/TryParseHelpers.cs @@ -39,12 +39,7 @@ public static class TryParseHelpers }; public static Delegate GetConverter(Type type) - { - if (_typeMap.TryGetValue(type, out var func)) - return func; - - else return null; - } + => _typeMap.TryGetValue(type, out var func) ? func : null; /// /// Parser implementation for the type. diff --git a/XmppSharp/Xml.cs b/XmppSharp/Xml.cs index 39df60e..b1c0681 100644 --- a/XmppSharp/Xml.cs +++ b/XmppSharp/Xml.cs @@ -1,5 +1,4 @@ using System.Globalization; -using System.Net.Http.Headers; using System.Text; using System.Xml; using XmppSharp.Parser; @@ -37,14 +36,14 @@ public static XmlQualifiedName ExtractQualifiedName(string source) }; } - public static async Task FromStringAsync(string xml, CancellationToken token = default) + public static async Task ParseFromStringAsync(string xml, CancellationToken token = default) { using (var ms = new MemoryStream(xml.GetBytes())) using (var parser = new XmppStreamParser(ms)) return await parser.GetNextElementAsync(token); } - public static async Task FromStreamAsync(Stream stream, CancellationToken token = default) + public static async Task ParseFromStreamAsync(Stream stream, CancellationToken token = default) { using (var parser = new XmppStreamParser(stream)) return await parser.GetNextElementAsync(token); diff --git a/XmppSharp/XmlFormatting.cs b/XmppSharp/XmlFormatting.cs index dd55098..74ae007 100644 --- a/XmppSharp/XmlFormatting.cs +++ b/XmppSharp/XmlFormatting.cs @@ -1,5 +1,4 @@ -using System.Diagnostics; -using System.Xml; +using System.Xml; namespace XmppSharp;