Skip to content

Commit

Permalink
Avoid Boxing/Unboxing on accessing elements of VBufferDataFrameColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
asmirnov82 committed Oct 16, 2023
1 parent 9c183fc commit c77f5f7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,7 @@ protected override void SetValue(long rowIndex, object value)
public new T? this[long rowIndex]
{
get => GetTypedValue(rowIndex);
set
{
if (value == null || value.GetType() == typeof(T))
{
_columnContainer[rowIndex] = value;
}
else
{
throw new ArgumentException(string.Format(Strings.MismatchedValueType, DataType), nameof(value));
}
}
set => _columnContainer[rowIndex] = value;
}

public override double Median()
Expand Down

0 comments on commit c77f5f7

Please sign in to comment.