Skip to content

Clean up PrimitiveColumnContainer #6656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use null instead of default for nullable values.
  • Loading branch information
JakeRadMSFT committed May 6, 2023
commit 0b8575d09ac980edf61c47ef267fef06ad5c2358
4 changes: 2 additions & 2 deletions src/Microsoft.Data.Analysis/PrimitiveColumnContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void ApplyElementwise(Func<T?, long, T?> func)
{
long curIndex = i + prevLength;
bool isValid = IsValid(mutableNullBitMapBuffer, i);
T? value = func(isValid ? mutableBuffer[i] : default(T?), curIndex);
T? value = func(isValid ? mutableBuffer[i] : null, curIndex);
mutableBuffer[i] = value.GetValueOrDefault();
SetValidityBit(mutableNullBitMapBuffer, i, value != null);
}
Expand All @@ -247,7 +247,7 @@ public void Apply<TResult>(Func<T?, TResult?> func, PrimitiveColumnContainer<TRe
{
long curIndex = i + prevLength;
bool isValid = IsValid(sourceNullBitMap, i);
TResult? value = func(isValid ? sourceBuffer[i] : default(T?));
TResult? value = func(isValid ? sourceBuffer[i] : null);
mutableResultBuffer[i] = value.GetValueOrDefault();
resultContainer.SetValidityBit(mutableResultNullBitMapBuffers, i, value != null);
}
Expand Down