Skip to content

Commit 8b16fc4

Browse files
committed
Remove redundant parenthesis.
1 parent d17368e commit 8b16fc4

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

MetadataExtractor.Tests/IO/IndexedReaderTestBase.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void TestGetInt16()
8787
reader.IsMotorolaByteOrder = false;
8888
Assert.Equal(0x0100, reader.GetInt16(0));
8989
Assert.Equal(0x7F01, reader.GetInt16(1));
90-
Assert.Equal(unchecked((short)(0xFF7F)), reader.GetInt16(2));
90+
Assert.Equal(unchecked((short)0xFF7F), reader.GetInt16(2));
9191
}
9292

9393

@@ -123,9 +123,9 @@ public void TestGetInt32()
123123
Assert.Equal(0x00017FFF, reader.GetInt32(0));
124124
Assert.Equal(0x017FFF02, reader.GetInt32(1));
125125
Assert.Equal(0x7FFF0203, reader.GetInt32(2));
126-
Assert.Equal(unchecked((int)(0xFF020304)), reader.GetInt32(3));
126+
Assert.Equal(unchecked((int)0xFF020304), reader.GetInt32(3));
127127
reader.IsMotorolaByteOrder = false;
128-
Assert.Equal(unchecked((int)(0xFF7F0100)), reader.GetInt32(0));
128+
Assert.Equal(unchecked((int)0xFF7F0100), reader.GetInt32(0));
129129
Assert.Equal(0x02FF7F01, reader.GetInt32(1));
130130
Assert.Equal(0x0302FF7F, reader.GetInt32(2));
131131
Assert.Equal(0x040302FF, reader.GetInt32(3));
@@ -170,7 +170,7 @@ public void TestGetInt64()
170170
Assert.Equal(unchecked(0x01020304050607FFL), (object)reader.GetInt64(1));
171171
reader.IsMotorolaByteOrder = false;
172172
Assert.Equal(unchecked(0x0706050403020100L), (object)reader.GetInt64(0));
173-
Assert.Equal(unchecked((long)(0xFF07060504030201L)), (object)reader.GetInt64(1));
173+
Assert.Equal(unchecked((long)0xFF07060504030201L), (object)reader.GetInt64(1));
174174
}
175175

176176
[Fact]
@@ -198,7 +198,7 @@ public void TestGetFloat32()
198198
[Fact]
199199
public void TestGetFloat64()
200200
{
201-
const long nanBits = unchecked((long)(0xfff0000000000001L));
201+
const long nanBits = unchecked((long)0xfff0000000000001L);
202202
Assert.True(double.IsNaN(BitConverter.Int64BitsToDouble(nanBits)));
203203
var buffer = new byte[] { 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
204204
var reader = CreateReader(buffer);

MetadataExtractor.Tests/IO/SequentialAccessTestBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void TestGetInt16()
9090
reader = CreateReader(buffer);
9191
reader.IsMotorolaByteOrder = false;
9292
Assert.Equal(0x0100, reader.GetInt16());
93-
Assert.Equal(unchecked((short)(0xFF7F)), reader.GetInt16());
93+
Assert.Equal(unchecked((short)0xFF7F), reader.GetInt16());
9494
}
9595

9696

@@ -163,10 +163,10 @@ public void TestGetInt64()
163163
{
164164
var buffer = new byte[] { 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
165165
var reader = CreateReader(buffer);
166-
Assert.Equal(unchecked((long)(0xFF00010203040506L)), (object)reader.GetInt64());
166+
Assert.Equal(unchecked((long)0xFF00010203040506L), (object)reader.GetInt64());
167167
reader = CreateReader(buffer);
168168
reader.IsMotorolaByteOrder = false;
169-
Assert.Equal(unchecked(0x06050403020100FFL), (object)reader.GetInt64());
169+
Assert.Equal(0x06050403020100FFL, (object)reader.GetInt64());
170170
}
171171

172172
[Fact]
@@ -192,7 +192,7 @@ public void TestGetFloat32()
192192
[Fact]
193193
public void TestGetFloat64()
194194
{
195-
const long nanBits = unchecked((long)(0xfff0000000000001L));
195+
const long nanBits = unchecked((long)0xfff0000000000001L);
196196
Assert.True(double.IsNaN(BitConverter.Int64BitsToDouble(nanBits)));
197197
var buffer = new byte[] { 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
198198
var reader = CreateReader(buffer);

MetadataExtractor/Formats/Exif/makernotes/OlympusFocusInfoMakernoteDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public string GetExternalFlashZoomDescription()
164164
if (values.Length == 0)
165165
return null;
166166

167-
var join = $"{values[0]}" + ((values.Length > 1) ? $"{ values[1]}" : "");
167+
var join = $"{values[0]}" + (values.Length > 1 ? $"{ values[1]}" : "");
168168

169169
switch (join)
170170
{

MetadataExtractor/Formats/Exif/makernotes/OlympusMakernoteDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ public string GetExposureCompensationDescription()
283283
{
284284
long value;
285285
return Directory.TryGetInt64(OlympusMakernoteDirectory.CameraSettings.TagExposureCompensation, out value)
286-
? $"{(value/3d - 2):0.##} EV"
286+
? $"{value/3d - 2:0.##} EV"
287287
: null;
288288
}
289289

MetadataExtractor/Formats/Exif/makernotes/SonyType1MakernoteDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public string GetColorTemperatureDescription()
195195
return null;
196196
if (value == 0)
197197
return "Auto";
198-
var kelvin = ((value & 0x00FF0000) >> 8) | ((value & unchecked((int)(0xFF000000))) >> 24);
198+
var kelvin = ((value & 0x00FF0000) >> 8) | ((value & unchecked((int)0xFF000000)) >> 24);
199199
return $"{kelvin} K";
200200
}
201201

MetadataExtractor/Formats/Icc/IccDescriptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ private static string FormatDoubleAsString(double value, int precision, bool zer
278278
var res = string.Empty;
279279
for (var i = precision; i > 0; i--)
280280
{
281-
var cour = unchecked((byte)(Math.Abs(rest % 10)));
281+
var cour = unchecked((byte)Math.Abs(rest % 10));
282282
rest /= 10;
283283
if (res.Length > 0 || zeroes || cour != 0 || i == 1)
284284
res = cour + res;
285285
}
286286

287287
intPart += rest;
288-
var isNegative = ((value < 0) && (intPart != 0 || restKept != 0));
288+
var isNegative = (value < 0) && (intPart != 0 || restKept != 0);
289289
return (isNegative ? "-" : string.Empty) + intPart + "." + res;
290290
}
291291

MetadataExtractor/Formats/Tiff/TiffReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static void ProcessIfd([NotNull] ITiffHandler handler, [NotNull] IndexedR
129129
reader.IsMotorolaByteOrder = !reader.IsMotorolaByteOrder;
130130
}
131131

132-
var dirLength = (2 + (12 * dirTagCount) + 4);
132+
var dirLength = 2 + 12*dirTagCount + 4;
133133
if (dirLength + ifdOffset > reader.Length)
134134
{
135135
handler.Error("Illegally sized IFD");

MetadataExtractor/Formats/Xmp/XmpDescriptor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ public string GetShutterSpeedDescription()
106106
// thanks also to Gli Blr for spotting this bug
107107
if (value <= 1)
108108
{
109-
var apexPower = (float)(1 / (Math.Exp(value * Math.Log(2))));
109+
var apexPower = (float)(1 / Math.Exp(value * Math.Log(2)));
110110
var apexPower10 = (long)Math.Round(apexPower * 10.0);
111111
var fApexPower = apexPower10 / 10.0f;
112112
return $"{fApexPower} sec";
113113
}
114114
else
115115
{
116-
var apexPower = (int)((Math.Exp(value * Math.Log(2))));
116+
var apexPower = (int)Math.Exp(value * Math.Log(2));
117117
return $"1/{apexPower} sec";
118118
}
119119
}

MetadataExtractor/IO/SequentialByteArrayReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ public override void Skip(long n)
7272
if (_index + n > _bytes.Length)
7373
throw new IOException("End of data reached.");
7474

75-
_index += unchecked((int)(n));
75+
_index += unchecked((int)n);
7676
}
7777

7878
public override bool TrySkip(long n)
7979
{
8080
if (n < 0)
8181
throw new ArgumentException("n must be zero or greater.");
8282

83-
_index += unchecked((int)(n));
83+
_index += unchecked((int)n);
8484

8585
if (_index > _bytes.Length)
8686
{

MetadataExtractor/Rational.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public string ToSimpleString(bool allowDecimal = true, IFormatProvider provider
237237
/// <returns>true if the simplification should be performed, otherwise false</returns>
238238
private bool TooComplexForSimplification()
239239
{
240-
var maxPossibleCalculations = (((Math.Min(Denominator, Numerator) - 1)/5d) + 2);
240+
var maxPossibleCalculations = (Math.Min(Denominator, Numerator) - 1)/5d + 2;
241241
const int maxSimplificationCalculations = 1000;
242242
return maxPossibleCalculations > maxSimplificationCalculations;
243243
}

0 commit comments

Comments
 (0)