diff options
| author | Phallacy <Dragoonmac@gmail.com> | 2019-03-07 03:11:41 -0800 |
|---|---|---|
| committer | Phallacy <Dragoonmac@gmail.com> | 2019-03-07 03:11:41 -0800 |
| commit | 8f4895e8a5bd1549f41bc1d4d2b31d03cff689ad (patch) | |
| tree | db2b697d08c778ba85ccce9d61f95e4b819b84f2 /MediaBrowser.Model | |
| parent | c31b0b311b339475650aa8812eb57152cac32d80 (diff) | |
more fixes for perf and style
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Cryptography/PasswordHash.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/MediaBrowser.Model/Cryptography/PasswordHash.cs b/MediaBrowser.Model/Cryptography/PasswordHash.cs index 72bdc6745..a9d0f6744 100644 --- a/MediaBrowser.Model/Cryptography/PasswordHash.cs +++ b/MediaBrowser.Model/Cryptography/PasswordHash.cs @@ -100,14 +100,14 @@ namespace MediaBrowser.Model.Cryptography public static byte[] ConvertFromByteString(string byteString)
{
- List<byte> bytes = new List<byte>();
+ byte[] bytes = new byte[byteString.Length / 2];
for (int i = 0; i < byteString.Length; i += 2)
{
// TODO: NetStandard2.1 switch this to use a span instead of a substring.
- bytes.Add(Convert.ToByte(byteString.Substring(i, 2), 16));
+ bytes[i / 2] = Convert.ToByte(byteString.Substring(i, 2), 16);
}
- return bytes.ToArray();
+ return bytes;
}
public static string ConvertToByteString(byte[] bytes)
@@ -117,18 +117,18 @@ namespace MediaBrowser.Model.Cryptography private string SerializeParameters()
{
- string ReturnString = string.Empty;
+ string returnString = string.Empty;
foreach (var KVP in _parameters)
{
- ReturnString += $",{KVP.Key}={KVP.Value}";
+ returnString += $",{KVP.Key}={KVP.Value}";
}
- if ((!string.IsNullOrEmpty(ReturnString)) && ReturnString[0] == ',')
+ if ((!string.IsNullOrEmpty(returnString)) && returnString[0] == ',')
{
- ReturnString = ReturnString.Remove(0, 1);
+ returnString = returnString.Remove(0, 1);
}
- return ReturnString;
+ return returnString;
}
public override string ToString()
|
