diff --git a/src/OneScript.Core/Commons/IndexedNameValueCollection.cs b/src/OneScript.Core/Commons/IndexedNameValueCollection.cs index 059764382..94e2631ff 100644 --- a/src/OneScript.Core/Commons/IndexedNameValueCollection.cs +++ b/src/OneScript.Core/Commons/IndexedNameValueCollection.cs @@ -58,7 +58,7 @@ public T this[string name] public void AddName(int index, string name) { if (index < 0 || index >= _values.Count) - throw new ArgumentOutOfRangeException(); + throw new ArgumentOutOfRangeException(nameof(index)); _nameIndex[name] = index; } diff --git a/src/OneScript.Language/IdentifiersTrie.cs b/src/OneScript.Language/IdentifiersTrie.cs index cacf088fb..df4b68a19 100644 --- a/src/OneScript.Language/IdentifiersTrie.cs +++ b/src/OneScript.Language/IdentifiersTrie.cs @@ -74,17 +74,17 @@ public void Add(string str, T val) node.Value = val; } - public bool ContainsKey(string str) + public bool ContainsKey(string key) { var node = _root; - foreach (char ch in str) + foreach (char ch in key) { - var key = node.Find(ch); - if (key == null) + var keyNode = node.Find(ch); + if (keyNode == null) { return false; } - node = key.next; + node = keyNode.next; } return node.next == null && node.HasValue; diff --git a/src/OneScript.StandardLibrary/Xml/XmlGlobalFunctions.cs b/src/OneScript.StandardLibrary/Xml/XmlGlobalFunctions.cs index 9d75a67ed..48acbc43b 100644 --- a/src/OneScript.StandardLibrary/Xml/XmlGlobalFunctions.cs +++ b/src/OneScript.StandardLibrary/Xml/XmlGlobalFunctions.cs @@ -138,21 +138,15 @@ public IValue XMLValue(IValue givenType, string presentation) { if (presentation.Trim() == "") return ValueFactory.Create(); - else - { - throw RuntimeException.InvalidNthArgumentValue(2); - } - return ValueFactory.Create(); + + throw RuntimeException.InvalidNthArgumentValue(2); } else if (typeValue.Equals(BasicTypes.Null)) { if (presentation.Trim() == "") return ValueFactory.CreateNullValue(); - else - { - throw RuntimeException.InvalidNthArgumentValue(2); - } - return ValueFactory.Create(); + + throw RuntimeException.InvalidNthArgumentValue(2); } else if (typeValue.ImplementingClass == typeof(GuidWrapper)) {