Core/Refactor: Part 2

This commit is contained in:
hondacrx
2018-05-07 22:07:35 -04:00
parent 216db1c23a
commit 9b40067017
93 changed files with 321 additions and 388 deletions
+3 -6
View File
@@ -57,7 +57,7 @@ namespace System
public static byte[] ToByteArray(this string value, char separator)
{
return Array.ConvertAll(value.Split(separator), s => byte.Parse(s));
return Array.ConvertAll(value.Split(separator), byte.Parse);
}
static uint LeftRotate(this uint value, int shiftCount)
@@ -144,7 +144,7 @@ namespace System
ret = (BigInteger)Convert.ChangeType(value, typeof(BigInteger));
break;
default:
throw new NotSupportedException(string.Format("'{0}' conversion to 'BigInteger' not supported.", typeof(T).Name));
throw new NotSupportedException($"'{typeof(T).Name}' conversion to 'BigInteger' not supported.");
}
return ret;
@@ -268,10 +268,7 @@ namespace System
string pattern = @"(%\W*\d*[a-zA-Z]*)";
int count = 0;
string result = Regex.Replace(str, pattern, m =>
{
return string.Concat("{", count++, "}");
});
string result = Regex.Replace(str, pattern, m => string.Concat("{", count++, "}"));
return result;
}