Closed bugadani closed 2 years ago
Name | Link |
---|---|
Latest commit | 09b00c85a4b5ef1b124fc433775d2ba542478a86 |
Latest deploy log | https://app.netlify.com/sites/cute-starship-2d9c9b/deploys/62b0958843924f0008744cc1 |
Deploy Preview | https://deploy-preview-60--cute-starship-2d9c9b.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Looks great, thanks!
This PR optimizes the
varint_*
functions to avoid an unnecessary bit masking.The idea behind this PR is the following:
(value >>= 7) == 0
, in which casevalue < 128
. In this case, the0x7F
masking isn't necessary.value > 128
we want to set the highest bit of the extracted byte to 1. In this case, the0x7F
masking isn't necessary, because we overwrite the masked bit anyway.Assuming I'm not catastrophically wrong, the resulting code optimizes slightly better: https://rust.godbolt.org/z/8dz48vocx