Conversation
iamcarbon
commented
Jan 21, 2024
- Updates mutable byte[] data in HuffmanTablesDirectory with statistically initialized data
- Adds and utilizes JpegSegment.Span property to reduce need for AsSpan()
- Uses static JpegSegmentPreambleBytes in DuckyReader
|
@drewnoakes Ready for review / feedback. CI is failing due to an ambiguous xunit method call (resolved in #366) |
drewnoakes
left a comment
There was a problem hiding this comment.
The other PR has merged so it should be possible to get the checks here to pass now.
Left some comments for potential future work too. We can file issues to track them if we feel they're valid.
| internal static ReadOnlySpan<byte> JpegSegmentPreambleBytes => "Ducky"u8; | ||
|
|
||
| ICollection<JpegSegmentType> IJpegSegmentMetadataReader.SegmentTypes { get; } = new[] { JpegSegmentType.AppC }; | ||
| ICollection<JpegSegmentType> IJpegSegmentMetadataReader.SegmentTypes { get; } = [JpegSegmentType.AppC]; |
There was a problem hiding this comment.
We should bump these to IReadOnlyCollection. Can be a future PR.
There was a problem hiding this comment.
Annoyingly, HashSet doesn't implement IReadOnlyCollection, which we use in JpegReader.
There was a problem hiding this comment.
Looking at usages of the property, they're all enumerations. So IReadOnlyCollection or IEnumerable are both candidates, and JpegReader would be changed to no longer use HashSet<T>.