Skip to content
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

Preamble segment handlers #291

Merged
merged 6 commits into from
May 16, 2021
Merged

Preamble segment handlers #291

merged 6 commits into from
May 16, 2021

Conversation

drewnoakes
Copy link
Owner

Several IJpegSegmentMetadataReader implementations behave in a similar manner. This PR pulls out a common base class for them, to reduce duplication and allow consistency.

Also some minor API changes around collection types. These are generally considered internal APIs, though of course some advanced users may have taken a dependency upon these. In such cases, recompiling against the new binary should be enough.

This change simplifies the code a little and improves performance, primarily by removing list allocations.

Previously this method would return a materialised collection. This is not necessary, and an enumeration of directories is sufficient.

This is an API change, but is unlikely to break many users as this interface is mostly used internally.

It also replaces runtime casts (for .NET 3.5, where interface covariance does not exist) with compile time casts.
The method used to return an enumerable, but the type was always a list. This allows a caller to avoid creating a new list if that is what they need, and advertises that this operation is not evaluated lazily.
Several IJpegSegmentMetadataReader implementations behave in a similar manner. This commit pulls out a common base class for them, to reduce duplication and allow consistency.
@drewnoakes drewnoakes merged commit db6b5cf into master May 16, 2021
@drewnoakes drewnoakes deleted the preamble-segment-handlers branch May 16, 2021 12:27
@kwhopper
Copy link
Collaborator

These are good revisions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants