Skip to content

Commit

Permalink
Remove redundant calls to this() in DataCell
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinungf committed Dec 2, 2023
1 parent c276c45 commit cc3f61b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions SpreadCheetah/DataCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public readonly record struct DataCell
/// Initializes a new instance of the <see cref="DataCell"/> struct with a text value.
/// If <c>value</c> is <c>null</c>, the cell will be empty.
/// </summary>
public DataCell(string? value) : this()
public DataCell(string? value)
{
StringValue = value != null ? WebUtility.HtmlEncode(value) : string.Empty;
_writer = value != null ? CellValueWriter.String : CellValueWriter.Null;
Expand All @@ -29,7 +29,7 @@ public DataCell(string? value) : this()
/// <summary>
/// Initializes a new instance of the <see cref="DataCell"/> struct with an integer value.
/// </summary>
public DataCell(int value) : this()
public DataCell(int value)
{
NumberValue = new CellValue(value);
_writer = CellValueWriter.Integer;
Expand All @@ -39,7 +39,7 @@ public DataCell(int value) : this()
/// Initializes a new instance of the <see cref="DataCell"/> struct with an integer value.
/// If <c>value</c> is <c>null</c>, the cell will be empty.
/// </summary>
public DataCell(int? value) : this()
public DataCell(int? value)
{
NumberValue = value is null ? new CellValue() : new CellValue(value.Value);
_writer = value is null ? CellValueWriter.Null : CellValueWriter.Integer;
Expand All @@ -65,7 +65,7 @@ public DataCell(long? value) : this((double?)value)
/// <summary>
/// Initializes a new instance of the <see cref="DataCell"/> struct with a floating point value.
/// </summary>
public DataCell(float value) : this()
public DataCell(float value)
{
NumberValue = new CellValue(value);
_writer = CellValueWriter.Float;
Expand All @@ -75,7 +75,7 @@ public DataCell(float value) : this()
/// Initializes a new instance of the <see cref="DataCell"/> struct with a floating-point value.
/// If <c>value</c> is <c>null</c>, the cell will be empty.
/// </summary>
public DataCell(float? value) : this()
public DataCell(float? value)
{
NumberValue = value is null ? new CellValue() : new CellValue(value.Value);
_writer = value is null ? CellValueWriter.Null : CellValueWriter.Float;
Expand All @@ -85,7 +85,7 @@ public DataCell(float? value) : this()
/// Initializes a new instance of the <see cref="DataCell"/> struct with a double-precision floating-point value.
/// Note that Open XML limits the precision to 15 significant digits for numbers. This could potentially lead to a loss of precision.
/// </summary>
public DataCell(double value) : this()
public DataCell(double value)
{
NumberValue = new CellValue(value);
_writer = CellValueWriter.Double;
Expand All @@ -96,7 +96,7 @@ public DataCell(double value) : this()
/// If <c>value</c> is <c>null</c>, the cell will be empty.
/// Note that Open XML limits the precision to 15 significant digits for numbers. This could potentially lead to a loss of precision.
/// </summary>
public DataCell(double? value) : this()
public DataCell(double? value)
{
NumberValue = value is null ? new CellValue() : new CellValue(value.Value);
_writer = value is null ? CellValueWriter.Null : CellValueWriter.Double;
Expand All @@ -123,7 +123,7 @@ public DataCell(decimal? value) : this(value != null ? decimal.ToDouble(value.Va
/// Initializes a new instance of the <see cref="DataCell"/> struct with a <see cref="DateTime"/> value.
/// Will be displayed in the number format from <see cref="SpreadCheetahOptions.DefaultDateTimeFormat"/>.
/// </summary>
public DataCell(DateTime value) : this()
public DataCell(DateTime value)
{
NumberValue = new CellValue(value.ToOADate());
_writer = CellValueWriter.DateTime;
Expand All @@ -134,7 +134,7 @@ public DataCell(DateTime value) : this()
/// Will be displayed in the number format from <see cref="SpreadCheetahOptions.DefaultDateTimeFormat"/>.
/// If <c>value</c> is <c>null</c>, the cell will be empty.
/// </summary>
public DataCell(DateTime? value) : this()
public DataCell(DateTime? value)
{
NumberValue = value is null ? new CellValue() : new CellValue(value.Value.ToOADate());
_writer = value is null ? CellValueWriter.NullDateTime : CellValueWriter.DateTime;
Expand All @@ -143,7 +143,7 @@ public DataCell(DateTime? value) : this()
/// <summary>
/// Initializes a new instance of the <see cref="DataCell"/> struct with a boolean value.
/// </summary>
public DataCell(bool value) : this()
public DataCell(bool value)
{
_writer = GetBooleanWriter(value);
}
Expand All @@ -152,7 +152,7 @@ public DataCell(bool value) : this()
/// Initializes a new instance of the <see cref="DataCell"/> struct with a boolean value.
/// If <c>value</c> is <c>null</c>, the cell will be empty.
/// </summary>
public DataCell(bool? value) : this()
public DataCell(bool? value)
{
_writer = value is null ? CellValueWriter.Null : GetBooleanWriter(value.Value);
}
Expand Down

0 comments on commit cc3f61b

Please sign in to comment.