Code cleanup

This commit is contained in:
erri120 2020-01-18 14:05:46 +01:00
parent ada207fb11
commit d7245a638a
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using IniParser;
@ -16,7 +15,7 @@ namespace Wabbajack.Common
public DynamicIniData(IniData value) //
{
this._value = value;
_value = value;
}
public static dynamic FromIni(IniData data)
@ -49,7 +48,7 @@ namespace Wabbajack.Common
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
result = _coll[binder.Name];
if (result is string) result = Interpret((string)result);
if (result is string s) result = Interpret(s);
return true;
}
@ -70,7 +69,7 @@ namespace Wabbajack.Common
private static string UnescapeUTF8(string s)
{
List<byte> acc = new List<byte>();
var acc = new List<byte>();
for (var i = 0; i < s.Length; i++)
{
var c = s[i];
@ -110,7 +109,7 @@ namespace Wabbajack.Common
}
result = _coll[(string) indexes[0]];
if (result is string) result = Regex.Unescape(((string)result).Trim('"'));
if (result is string s) result = Regex.Unescape(s.Trim('"'));
return true;
}
}