diff --git a/ArrayIsEmpty.cs b/ArrayIsEmpty.cs
index a51f90079..d04586f71 100644
--- a/ArrayIsEmpty.cs
+++ b/ArrayIsEmpty.cs
@@ -39,12 +39,11 @@ namespace Aaru.Helpers
/// Checks if an array is null, filled with the NULL byte (0x00) or ASCII whitespace (0x20)
/// Array
/// True if null or whitespace
- public static bool ArrayIsNullOrWhiteSpace(byte[] array) =>
- array == null || array.All(b => b == 0x00 || b == 0x20);
+ public static bool ArrayIsNullOrWhiteSpace(byte[] array) => array?.All(b => b == 0x00 || b == 0x20) != false;
/// Checks if an array is null or filled with the NULL byte (0x00)
/// Array
/// True if null
- public static bool ArrayIsNullOrEmpty(byte[] array) => array == null || array.All(b => b == 0x00);
+ public static bool ArrayIsNullOrEmpty(byte[] array) => array?.All(b => b == 0x00) != false;
}
}
\ No newline at end of file
diff --git a/CountBits.cs b/CountBits.cs
index 60704df73..54914f3f5 100644
--- a/CountBits.cs
+++ b/CountBits.cs
@@ -39,8 +39,8 @@ namespace Aaru.Helpers
/// Bits set to true
public static int Count(uint number)
{
- number = number - ((number >> 1) & 0x55555555);
- number = (number & 0x33333333) + ((number >> 2) & 0x33333333);
+ number -= (number >> 1) & 0x55555555;
+ number = (number & 0x33333333) + ((number >> 2) & 0x33333333);
return (int)((((number + (number >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24);
}
diff --git a/DateHandlers.cs b/DateHandlers.cs
index 28fd153ca..6bca1e341 100644
--- a/DateHandlers.cs
+++ b/DateHandlers.cs
@@ -313,7 +313,7 @@ namespace Aaru.Helpers
AddTicks(ticks).DateTime;
}
- /// Convers a Solaris high resolution timestamp to .NET DateTime
+ /// Converts a Solaris high resolution timestamp to .NET DateTime
/// Solaris high resolution timestamp
/// .NET DateTime
public static DateTime UnixHrTimeToDateTime(ulong hrTimeStamp) =>
diff --git a/MarshallingPropertiesAttribute.cs b/MarshallingPropertiesAttribute.cs
index 954488341..bb91ac3c7 100644
--- a/MarshallingPropertiesAttribute.cs
+++ b/MarshallingPropertiesAttribute.cs
@@ -42,7 +42,7 @@ namespace Aaru.Helpers
{
/// Defines properties to help marshalling structs from binary data
[AttributeUsage(AttributeTargets.Struct)]
- public class MarshallingPropertiesAttribute : Attribute
+ public sealed class MarshallingPropertiesAttribute : Attribute
{
/// Defines properties to help marshalling structs from binary data
/// Defines properties to help marshalling structs from binary data
diff --git a/StringHandlers.cs b/StringHandlers.cs
index d2128cd72..f99eceada 100644
--- a/StringHandlers.cs
+++ b/StringHandlers.cs
@@ -47,7 +47,7 @@ namespace Aaru.Helpers
/// A null-terminated (aka C string) byte array in the specified encoding
/// Encoding.
/// Set if encoding uses 16-bit characters.
- /// Start decodint at this position
+ /// Start decoding at this position
public static string CToString(byte[] cString, Encoding encoding, bool twoBytes = false, int start = 0)
{
if(cString == null)
@@ -92,7 +92,7 @@ namespace Aaru.Helpers
/// The corresponding C# string
/// A length-prefixed (aka Pascal string) ASCII byte array
/// Encoding.
- /// Start decodint at this position
+ /// Start decoding at this position
public static string PascalToString(byte[] pascalString, Encoding encoding, int start = 0)
{
if(pascalString == null)
@@ -125,7 +125,7 @@ namespace Aaru.Helpers
/// The corresponding C# string
/// A space (' ', 0x20, ASCII SPACE) padded ASCII byte array
/// Encoding.
- /// Start decodint at this position
+ /// Start decoding at this position
public static string SpacePaddedToString(byte[] spacePaddedString, Encoding encoding, int start = 0)
{
if(spacePaddedString == null)