image-rs / image-gif

GIF en- and decoder
Apache License 2.0
148 stars 42 forks source link

Extract next_state bits into functions #181

Closed kornelski closed 5 months ago

kornelski commented 5 months ago

I've noticed that optimizer was failing to perform obvious optimizations like eliminating a check for equal slice lengths in slice[..len].copy_from_slice(&buf[..len]). Moving this code to a separate function helped. next_state may be big enough to be hard to optimize.