Skip to content

Commit 8cd3d39

Browse files
committed
Merge commit 'f4d3a6ecac44fbc83e121c9476fe240bf9329316' into jakerad_generic_math
2 parents 9218375 + f4d3a6e commit 8cd3d39

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

src/Microsoft.Data.Analysis/DataFrameBuffer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ internal override T this[int index]
7777
{
7878
set
7979
{
80-
if (index > Length)
80+
if (index >= Length)
8181
throw new ArgumentOutOfRangeException(nameof(index));
82+
8283
RawSpan[index] = value;
8384
}
8485
}

src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected internal override Apache.Arrow.Array ToArrowArray(long startIndex, int
165165
{
166166
get
167167
{
168-
if (startIndex > Length)
168+
if (startIndex >= Length)
169169
{
170170
throw new ArgumentOutOfRangeException(nameof(startIndex));
171171
}
@@ -175,7 +175,7 @@ protected internal override Apache.Arrow.Array ToArrowArray(long startIndex, int
175175

176176
protected override IReadOnlyList<object> GetValues(long startIndex, int length)
177177
{
178-
if (startIndex > Length)
178+
if (startIndex >= Length)
179179
{
180180
throw new ArgumentOutOfRangeException(nameof(startIndex));
181181
}

src/Microsoft.Data.Analysis/ReadOnlyDataFrameBuffer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ internal virtual T this[int index]
6666
{
6767
get
6868
{
69-
if (index > Length)
69+
if (index >= Length)
7070
throw new ArgumentOutOfRangeException(nameof(index));
71+
7172
return ReadOnlySpan[index];
7273
}
7374
set => throw new NotSupportedException();

src/Microsoft.Data.Analysis/StringDataFrameColumn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void Append(string value)
7777

7878
private int GetBufferIndexContainingRowIndex(ref long rowIndex)
7979
{
80-
if (rowIndex > Length)
80+
if (rowIndex >= Length)
8181
{
8282
throw new ArgumentOutOfRangeException(Strings.ColumnIndexOutOfRange, nameof(rowIndex));
8383
}

src/Microsoft.Data.Analysis/VBufferDataFrameColumn.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ public void Append(VBuffer<T> value)
8585

8686
private int GetBufferIndexContainingRowIndex(ref long rowIndex)
8787
{
88-
if (rowIndex > Length)
88+
if (rowIndex >= Length)
8989
{
9090
throw new ArgumentOutOfRangeException(Strings.ColumnIndexOutOfRange, nameof(rowIndex));
9191
}
92+
9293
return (int)(rowIndex / int.MaxValue);
9394
}
9495

0 commit comments

Comments
 (0)