diff --git a/src/SharpCompress/Archives/Rar/RarArchiveVolumeFactory.cs b/src/SharpCompress/Archives/Rar/RarArchiveVolumeFactory.cs index 2e96feac..882135e0 100644 --- a/src/SharpCompress/Archives/Rar/RarArchiveVolumeFactory.cs +++ b/src/SharpCompress/Archives/Rar/RarArchiveVolumeFactory.cs @@ -68,7 +68,7 @@ namespace SharpCompress.Archives.Rar // .rar, .r00, .r01, ... string extension = currentFileInfo.Extension; - StringBuilder buffer = new StringBuilder(currentFileInfo.FullName.Length); + var buffer = new StringBuilder(currentFileInfo.FullName.Length); buffer.Append(currentFileInfo.FullName.Substring(0, currentFileInfo.FullName.Length - extension.Length)); if (string.Compare(extension, ".rar", StringComparison.OrdinalIgnoreCase) == 0) @@ -77,8 +77,7 @@ namespace SharpCompress.Archives.Rar } else { - int num = 0; - if (int.TryParse(extension.Substring(2, 2), out num)) + if (int.TryParse(extension.Substring(2, 2), out int num)) { num++; buffer.Append(".r"); @@ -111,12 +110,11 @@ namespace SharpCompress.Archives.Rar } StringBuilder buffer = new StringBuilder(currentFileInfo.FullName.Length); buffer.Append(currentFileInfo.FullName, 0, startIndex); - int num = 0; string numString = currentFileInfo.FullName.Substring(startIndex + 5, currentFileInfo.FullName.IndexOf('.', startIndex + 5) - startIndex - 5); buffer.Append(".part"); - if (int.TryParse(numString, out num)) + if (int.TryParse(numString, out int num)) { num++; for (int i = 0; i < numString.Length - num.ToString().Length; i++) diff --git a/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs b/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs index 62c4bb61..2c076ea3 100644 --- a/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs +++ b/src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs @@ -34,9 +34,7 @@ namespace SharpCompress.Compressors.LZMA throw new NotSupportedException("AES decoder does not support padding."); } - int numCyclesPower; - byte[] salt, seed; - Init(info, out numCyclesPower, out salt, out seed); + Init(info, out int numCyclesPower, out byte[] salt, out byte[] seed); byte[] password = Encoding.Unicode.GetBytes(pass.CryptoGetTextPassword()); byte[] key = InitKey(numCyclesPower, salt, password);