Uh oh!
There was an error while loading. Please reload this page.
StreamOnSqlBytes Read/Write on Spans - #86674
Conversation
ghost
commented
May 23, 2023
Tagging subscribers to this area: @roji, @ajcvickers Issue DetailsClose #69921
|
| // Adjust count based on data length | ||
| int count = Math.Min(buffer.Length, (int)(Length - offset)); | ||
| Span<byte> span = _rgbBuf!.AsSpan((int)offset, count); |
There was a problem hiding this comment.
Instead of the null-forgiving operator I'd prefer a Debug.Assert(_rgbBuf is not null), as in case it's actually null, then in CI the assert fails.
Same on other places.
Except it's really 100 % sure that it can't be null here, then ignore this comment.
There was a problem hiding this comment.
I copied all of ! from old array-based methods so I assume we are 100% sure
There was a problem hiding this comment.
Please remove the ! and add the assert. The ! was ok when this was in the Read method that was also checking IsNull and throwing, but now this is reachable from an internal method that has no such check.
There was a problem hiding this comment.
But internal method also has IsNull check under your comment about arguments order 🤔
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // Adjust count based on data length | ||
| int count = Math.Min(buffer.Length, (int)(Length - offset)); | ||
| Span<byte> span = _rgbBuf!.AsSpan((int)offset, count); |
There was a problem hiding this comment.
Please remove the ! and add the assert. The ! was ok when this was in the Read method that was also checking IsNull and throwing, but now this is reachable from an internal method that has no such check.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
danmoseley
commented
Oct 16, 2023
@stephentoub do you have other feedback here? @ajcvickers is there someone from code owners that can review it ? |
stephentoub
commented
Jan 29, 2024
All test failures are known |
Close#69921