From c77f5f7297118cc05dfe9507a452c356ab9afe38 Mon Sep 17 00:00:00 2001 From: Aleksei Smirnov Date: Mon, 16 Oct 2023 15:01:42 +0300 Subject: [PATCH] Avoid Boxing/Unboxing on accessing elements of VBufferDataFrameColumn --- .../PrimitiveDataFrameColumn.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs index 54fc1744a2..7991d6b728 100644 --- a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs @@ -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()