image-rs / color_quant

Color quantization library
MIT License
35 stars 16 forks source link

check 0 and refactor search netindex #16

Closed JulianKnodt closed 2 years ago

JulianKnodt commented 3 years ago

Previously, the 0th index was never being checked, and it would eagerly exit if a one-directional check completed before the other. This diverged from the original implementation (which in itself isn't a problem), but I think the behavior is likely not what was intended. This refactors makes the function clearer, and removes both of the aforementioned behaviors. It should maintain the same efficiency, but it's not clear since there are no benchmarks.

I was going to wait until the example was merged to use it to compare the before and after of this, and I can still do that if that's better.

JulianKnodt commented 2 years ago

@HeroicKatora Just wanted to ping you about this, I understand you're probably busy, but in case you missed it!