Skip to content

Commit b959ffb

Browse files
committed
Remove leftovers of bool support
1 parent 9cc24d2 commit b959ffb

File tree

9 files changed

+8
-23
lines changed

9 files changed

+8
-23
lines changed

Src/FastData.Generator.CPlusPlus/Internal/Framework/CPlusPlusHashDef.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private static string GetHash(DataType dataType)
3636
""";
3737
}
3838

39-
if (dataType.IsIdentityHash() || dataType == DataType.Boolean)
39+
if (dataType.IsIdentityHash())
4040
return " return static_cast<uint64_t>(value);";
4141

4242
if (dataType == DataType.Single)

Src/FastData.Generator.CPlusPlus/Internal/Framework/CPlusPlusLanguageDef.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ internal class CPlusPlusLanguageDef : ILanguageDef
2121
new IntegerTypeDef<ulong>("uint64_t", ulong.MinValue, ulong.MaxValue, "0", "std::numeric_limits<uint64_t>::max()", x => x.ToString(NumberFormatInfo.InvariantInfo) + "ull"),
2222
new IntegerTypeDef<float>("float", float.MinValue, float.MaxValue, "std::numeric_limits<float>::lowest()", "std::numeric_limits<float>::max()", x => x.ToString("0.0", NumberFormatInfo.InvariantInfo) + "f"),
2323
new IntegerTypeDef<double>("double", double.MinValue, double.MaxValue, "std::numeric_limits<double>::lowest()", "std::numeric_limits<double>::max()", x => x.ToString("0.0", NumberFormatInfo.InvariantInfo)),
24-
new StringTypeDef("std::string_view"),
25-
new BoolTypeDef("bool")
24+
new StringTypeDef("std::string_view")
2625
};
2726
}

Src/FastData.Generator.CSharp/Internal/Framework/CSharpLanguageDef.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ internal class CSharpLanguageDef : ILanguageDef
2121
new IntegerTypeDef<ulong>("ulong", ulong.MinValue, ulong.MaxValue, "ulong.MinValue", "ulong.MaxValue", x => x.ToString(NumberFormatInfo.InvariantInfo) + "ul"),
2222
new IntegerTypeDef<float>("float", float.MinValue, float.MaxValue, "float.MinValue", "float.MaxValue", x => x.ToString(NumberFormatInfo.InvariantInfo) + "f"),
2323
new IntegerTypeDef<double>("double", double.MinValue, double.MaxValue, "double.MinValue", "double.MaxValue", x => x.ToString("0.0", NumberFormatInfo.InvariantInfo)),
24-
new StringTypeDef("string"),
25-
new BoolTypeDef("bool")
24+
new StringTypeDef("string")
2625
};
2726
}

Src/FastData.Generator.Rust/Internal/Framework/RustHashDef.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private static string GetHash(DataType dataType)
3333
""";
3434
}
3535

36-
if (dataType.IsIdentityHash() || dataType == DataType.Boolean)
36+
if (dataType.IsIdentityHash())
3737
return " value as u64";
3838

3939
if (dataType == DataType.Single)

Src/FastData.Generator.Rust/Internal/Framework/RustLanguageDef.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ internal class RustLanguageDef : ILanguageDef
2121
new IntegerTypeDef<ulong>("u64", ulong.MinValue, ulong.MaxValue, "u64::MIN", "u64::MAX"),
2222
new IntegerTypeDef<float>("f32", float.MinValue, float.MaxValue, "f32::MIN", "f32::MAX", x => x.ToString("0.0", NumberFormatInfo.InvariantInfo)),
2323
new IntegerTypeDef<double>("f64", double.MinValue, double.MaxValue, "f64::MIN", "f64::MAX", x => x.ToString("0.0", NumberFormatInfo.InvariantInfo)),
24-
new StringTypeDef("&str"),
25-
new BoolTypeDef("bool")
24+
new StringTypeDef("&str")
2625
};
2726
}

Src/FastData.Generator/Framework/Definitions/BoolTypeDef.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.

Src/FastData/Enums/DataType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public enum DataType : byte
88

99
// Object = 1,
1010
// DBNull = 2,
11-
Boolean = 3,
11+
// Boolean = 3,
1212
Char = 4,
1313
SByte = 5,
1414
Byte = 6,

Src/FastData/Generators/Extensions/DataTypeExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class DataTypeExtensions
1111
public static bool IsInteger(this DataType type) => type switch
1212
{
1313
DataType.SByte or DataType.Int16 or DataType.Int32 or DataType.Int64 or DataType.Single or DataType.Double or DataType.UInt32 or DataType.UInt16 or DataType.UInt64 or DataType.Byte or DataType.Char => true,
14-
DataType.String or DataType.Boolean => false,
14+
DataType.String => false,
1515
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
1616
};
1717

@@ -21,7 +21,7 @@ public static class DataTypeExtensions
2121
public static bool IsIdentityHash(this DataType type) => type switch
2222
{
2323
DataType.Char or DataType.SByte or DataType.Byte or DataType.Int16 or DataType.UInt16 or DataType.Int32 or DataType.UInt32 or DataType.Int64 or DataType.UInt64 => true,
24-
DataType.Boolean or DataType.String or DataType.Single or DataType.Double => false,
24+
DataType.String or DataType.Single or DataType.Double => false,
2525
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null)
2626
};
2727
}

Src/FastData/Internal/Misc/PrimitiveHash.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ internal static class PrimitiveHash
88
{
99
internal static HashFunc<T> GetHash<T>(DataType dataType) => dataType switch
1010
{
11-
DataType.Boolean => static obj => unchecked((ulong)((bool)(object)obj! ? 1 : 0)),
1211
DataType.Char => static obj => (char)(object)obj!,
1312
DataType.SByte => static obj => unchecked((ulong)(sbyte)(object)obj!),
1413
DataType.Byte => static obj => (byte)(object)obj!,

0 commit comments

Comments
 (0)