Skip to content

Commit 321158d

Browse files
authored
Clean DataFrame meaningless code (#6761)
1 parent 69cc4bc commit 321158d

File tree

2 files changed

+1
-33
lines changed

2 files changed

+1
-33
lines changed

src/Microsoft.Data.Analysis/DataFrame.IO.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ public static DataFrame LoadFrom(IEnumerable<IList<object>> vals, IList<(string,
127127

128128
foreach (var items in vals)
129129
{
130-
for (var c = 0; c < items.Count; c++)
131-
{
132-
items[c] = items[c];
133-
}
134130
res.Append(items, inPlace: true);
135131
}
136132

src/Microsoft.Data.Analysis/PrimitiveColumnContainer.cs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,35 +44,6 @@ internal partial class PrimitiveColumnContainer<T> : IEnumerable<T?>
4444
// Need a way to differentiate between columns initialized with default values and those with null values in SetValidityBit
4545
internal bool _modifyNullCountWhileIndexing = true;
4646

47-
public PrimitiveColumnContainer(T[] values)
48-
{
49-
values = values ?? throw new ArgumentNullException(nameof(values));
50-
long length = values.LongLength;
51-
DataFrameBuffer<T> curBuffer;
52-
if (Buffers.Count == 0)
53-
{
54-
curBuffer = new DataFrameBuffer<T>();
55-
Buffers.Add(curBuffer);
56-
NullBitMapBuffers.Add(new DataFrameBuffer<byte>());
57-
}
58-
else
59-
{
60-
curBuffer = (DataFrameBuffer<T>)Buffers[Buffers.Count - 1];
61-
}
62-
for (long i = 0; i < length; i++)
63-
{
64-
if (curBuffer.Length == ReadOnlyDataFrameBuffer<T>.MaxCapacity)
65-
{
66-
curBuffer = new DataFrameBuffer<T>();
67-
Buffers.Add(curBuffer);
68-
NullBitMapBuffers.Add(new DataFrameBuffer<byte>());
69-
}
70-
curBuffer.Append(values[i]);
71-
SetValidityBit(Length, true);
72-
Length++;
73-
}
74-
}
75-
7647
public PrimitiveColumnContainer(IEnumerable<T> values)
7748
{
7849
values = values ?? throw new ArgumentNullException(nameof(values));
@@ -81,6 +52,7 @@ public PrimitiveColumnContainer(IEnumerable<T> values)
8152
Append(value);
8253
}
8354
}
55+
8456
public PrimitiveColumnContainer(IEnumerable<T?> values)
8557
{
8658
values = values ?? throw new ArgumentNullException(nameof(values));

0 commit comments

Comments
 (0)