-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Replace DvBool with .NET standard type. #692
Changes from 3 commits
281f2f2
4385afe
b0f624a
5957ca5
92cd8c9
e2882ae
bac9601
9adcf70
1120e24
1b1f3e2
53b4e57
06c6b12
b0568ca
ee97d47
924cb8a
b2e3916
bdccd8f
1b72099
ed050ec
ffc1f8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,12 +174,7 @@ private Delegate CreateGetter(int index) | |
else if (outputType.GetElementType() == typeof(bool)) | ||
{ | ||
Ch.Assert(colType.ItemType.IsBool); | ||
return CreateConvertingArrayGetterDelegate<bool, DvBool>(index, x => x); | ||
} | ||
else if (outputType.GetElementType() == typeof(bool?)) | ||
{ | ||
Ch.Assert(colType.ItemType.IsBool); | ||
return CreateConvertingArrayGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA); | ||
return CreateConvertingArrayGetterDelegate<bool, bool>(index, x => x); | ||
} | ||
|
||
// T[] -> VBuffer<T> | ||
|
@@ -210,15 +205,9 @@ private Delegate CreateGetter(int index) | |
} | ||
else if (outputType == typeof(bool)) | ||
{ | ||
// Bool -> DvBool | ||
Ch.Assert(colType.IsBool); | ||
return CreateConvertingGetterDelegate<bool, DvBool>(index, x => x); | ||
} | ||
else if (outputType == typeof(bool?)) | ||
{ | ||
// Bool? -> DvBool | ||
// Bool -> Bool. | ||
Ch.Assert(colType.IsBool); | ||
return CreateConvertingGetterDelegate<bool?, DvBool>(index, x => x ?? DvBool.NA); | ||
return CreateConvertingGetterDelegate<bool, bool>(index, x => x); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
not needed, fall back to T-> T default #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
else if (outputType == typeof(int)) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -282,12 +282,7 @@ private Action<TRow> GenerateSetter(IRow input, int index, InternalSchemaDefinit | |
else if (fieldType.GetElementType() == typeof(bool)) | ||
{ | ||
Ch.Assert(colType.ItemType.IsBool); | ||
return CreateConvertingVBufferSetter<DvBool, bool>(input, index, poke, peek, x => (bool)x); | ||
} | ||
else if (fieldType.GetElementType() == typeof(bool?)) | ||
{ | ||
Ch.Assert(colType.ItemType.IsBool); | ||
return CreateConvertingVBufferSetter<DvBool, bool?>(input, index, poke, peek, x => (bool?)x); | ||
return CreateConvertingVBufferSetter<bool, bool>(input, index, poke, peek, x => x); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fall back to // VBuffer -> T[] #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
else if (fieldType.GetElementType() == typeof(int)) | ||
{ | ||
|
@@ -361,13 +356,7 @@ private Action<TRow> GenerateSetter(IRow input, int index, InternalSchemaDefinit | |
{ | ||
Ch.Assert(colType.IsBool); | ||
Ch.Assert(peek == null); | ||
return CreateConvertingActionSetter<DvBool, bool>(input, index, poke, x => (bool)x); | ||
} | ||
else if (fieldType == typeof(bool?)) | ||
{ | ||
Ch.Assert(colType.IsBool); | ||
Ch.Assert(peek == null); | ||
return CreateConvertingActionSetter<DvBool, bool?>(input, index, poke, x => (bool?)x); | ||
return CreateConvertingActionSetter<bool, bool>(input, index, poke, x => x); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
fall back to // T -> T #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
else if (fieldType == typeof(int)) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't have to do it.
just fall back to default T[] -> VBuffer code. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course.
In reply to: 211109130 [](ancestors = 211109130)