@@ -970,8 +970,8 @@ private static bool IsInRange(char c, char min, char max)
970
970
971
971
private static Polynom CalculateMessagePolynom ( BitArray bitArray , int offset , int count )
972
972
{
973
- var messagePol = new Polynom ( count / 8 ) ;
974
- for ( var i = count / 8 - 1 ; i >= 0 ; i -- )
973
+ var messagePol = new Polynom ( count /= 8 ) ;
974
+ for ( var i = count - 1 ; i >= 0 ; i -- )
975
975
{
976
976
messagePol . PolyItems . Add ( new PolynomItem ( BinToDec ( bitArray , offset , 8 ) , i ) ) ;
977
977
offset += 8 ;
@@ -1003,7 +1003,7 @@ private static byte[] BinaryStringToBitBlockByteList(BitArray bitString, int off
1003
1003
{
1004
1004
const int blockSize = 8 ;
1005
1005
if ( count % blockSize != 0 )
1006
- throw new ArgumentException ( "Count must be a multiple of 8." , nameof ( count ) ) ;
1006
+ ThrowArgumentException ( nameof ( count ) ) ;
1007
1007
var numberOfBlocks = ( int ) ( ( uint ) count / blockSize ) ;
1008
1008
var blocklist = new byte [ numberOfBlocks ] ;
1009
1009
@@ -1023,6 +1023,8 @@ private static byte[] BinaryStringToBitBlockByteList(BitArray bitString, int off
1023
1023
}
1024
1024
1025
1025
return blocklist ;
1026
+
1027
+ void ThrowArgumentException ( string paramName ) => throw new ArgumentOutOfRangeException ( paramName , "Count must be a multiple of 8." ) ;
1026
1028
}
1027
1029
1028
1030
private static int BinToDec ( BitArray bitArray , int offset , int count )
@@ -1350,8 +1352,10 @@ private static int GetIntValFromAlphaExp(int exp)
1350
1352
private static int GetAlphaExpFromIntVal ( int intVal )
1351
1353
{
1352
1354
if ( intVal == 0 )
1353
- throw new ArgumentOutOfRangeException ( nameof ( intVal ) ) ;
1355
+ ThrowArgumentOutOfRangeException ( nameof ( intVal ) ) ;
1354
1356
return galoisFieldByIntegerValue [ intVal ] ;
1357
+
1358
+ void ThrowArgumentOutOfRangeException ( string paramName ) => throw new ArgumentOutOfRangeException ( paramName ) ;
1355
1359
}
1356
1360
1357
1361
private static int ShrinkAlphaExp ( int alphaExp )
0 commit comments