Closed nico-abram closed 4 years ago
Oh yeah, that's just an oversight. Will just change it to use a safe lookup, compiler may optimize it anyway. Thought I had done a search for unsafe. The function is only used RLE mode, which has to explicitly chosen when compressing so it's not often used.
https://github.com/image-rs/deflate-rs/blob/2385f2a87fae302b9246fc894dbddbba40c7e07c/src/output_writer.rs#L101
I don't personally think this is a big deal and I think the readme is probably just outdated, but imo the readme should be corrected. Would something like "There is a single instance of unsafe behind a feature flag that proved to measurably affect performance" be ok?