Remora / Remora.Rest

Reusable tooling for interacting with JSON-driven REST APIs
GNU Lesser General Public License v3.0
7 stars 10 forks source link

Add Span-based overloads of IsPNG, IsGIF, IsJPG #15

Closed uwx closed 2 years ago

uwx commented 2 years ago

Adds Span-based overloads of the extension methods in TypeDetectionExtensions. I haven't removed the existing byte[] methods as that would break binary compatibility and possibly source compatibility (not sure on the latter).

MazeXP commented 2 years ago

Would it be a performance impact when actually having the IsPNG(byte[]) extension call the Span based extension by just passing the byte[] as ROS? Just thinking about avoiding duplicate code.

uwx commented 2 years ago

Would it be a performance impact when actually having the IsPNG(byte[]) extension call the Span based extension by just passing the byte[] as ROS? Just thinking about avoiding duplicate code.

That can be done, if desired. There should be no performance impact; it would look the same jitted.

Nihlus commented 2 years ago

I would prefer that, yeah.

uwx commented 2 years ago

Done.

MazeXP commented 2 years ago

LGTM, thanks.