diff --git a/ArrayFill.cs b/ArrayFill.cs index 733a351..e443f7b 100644 --- a/ArrayFill.cs +++ b/ArrayFill.cs @@ -39,12 +39,9 @@ namespace DiscImageChef public static void ArrayFill(T[] destinationArray, T[] value) { - if(destinationArray == null) { throw new ArgumentNullException(nameof(destinationArray)); } + if(destinationArray == null) throw new ArgumentNullException(nameof(destinationArray)); - if(value.Length > destinationArray.Length) - { - throw new ArgumentException("Length of value array must not be more than length of destination"); - } + if(value.Length > destinationArray.Length) throw new ArgumentException("Length of value array must not be more than length of destination"); // set the initial array value Array.Copy(value, destinationArray, value.Length); @@ -52,10 +49,7 @@ namespace DiscImageChef int arrayToFillHalfLength = destinationArray.Length / 2; int copyLength; - for(copyLength = value.Length; copyLength < arrayToFillHalfLength; copyLength <<= 1) - { - Array.Copy(destinationArray, 0, destinationArray, copyLength, copyLength); - } + for(copyLength = value.Length; copyLength < arrayToFillHalfLength; copyLength <<= 1) Array.Copy(destinationArray, 0, destinationArray, copyLength, copyLength); Array.Copy(destinationArray, 0, destinationArray, copyLength, destinationArray.Length - copyLength); } diff --git a/DateHandlers.cs b/DateHandlers.cs index a13c5ff..9d394fb 100644 --- a/DateHandlers.cs +++ b/DateHandlers.cs @@ -233,7 +233,7 @@ namespace DiscImageChef ushort preOffset = (ushort)(typeAndTimeZone & 0xFFF); short offset; - if((preOffset & 0x800) == 0x800) { offset = (short)(preOffset | 0xF000); } + if((preOffset & 0x800) == 0x800) offset = (short)(preOffset | 0xF000); else offset = (short)(preOffset & 0x7FF); if(offset == -2047) diff --git a/EndianAwareBinaryReader.cs b/EndianAwareBinaryReader.cs index b0d6366..496f667 100644 --- a/EndianAwareBinaryReader.cs +++ b/EndianAwareBinaryReader.cs @@ -122,21 +122,19 @@ namespace DiscImageChef if(numBytes == 1) { num2 = BaseStream.ReadByte(); - if(num2 == -1) { throw new EndOfStreamException("Attempted to read past the end of the stream."); } + if(num2 == -1) throw new EndOfStreamException("Attempted to read past the end of the stream."); buffer[0] = (byte)num2; } else - { do { num2 = BaseStream.Read(buffer, offset, numBytes - offset); - if(num2 == 0) { throw new EndOfStreamException("Attempted to read past the end of the stream."); } + if(num2 == 0) throw new EndOfStreamException("Attempted to read past the end of the stream."); offset += num2; } while(offset < numBytes); - } } } } \ No newline at end of file