datrs / hypercore

Secure, distributed, append-only log
https://docs.rs/hypercore
Apache License 2.0
332 stars 37 forks source link

Simplify lookup table generation in masks.rs #3

Closed khernyo closed 6 years ago

khernyo commented 6 years ago

This PR simplifies some non-obvious lookup table generating code in masks.rs by using rust built-in bit-fiddling methods.

This change is split into three commits only for easier verification. It can be squashed safely without loosing any relevant history.

Checklist

Semver Changes

Patch level

khernyo commented 6 years ago

It fails because of clippy, but clippy fails on master too. I will open a PR with those fixes tomorrow.

yoshuawuyts commented 6 years ago

Oh, this is amazing!

I'm just rounding out my day today, but promise to take a closer look tomorrow. From a quick glance this is looking exactly the way we would want it to be! :D