mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 01:41:37 +03:00
ur: cleans up ur_bsr_log()
This commit is contained in:
parent
bf20b93e4d
commit
bc3c1eb0c7
@ -615,7 +615,6 @@ ur_bsr_log(ur_bsr_t *bsr, uint8_t *out)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uint8_t off = bsr->off;
|
uint8_t off = bsr->off;
|
||||||
uint8_t rest = 8 - off;
|
|
||||||
const uint8_t *b = bsr->bytes;
|
const uint8_t *b = bsr->bytes;
|
||||||
uint8_t byt = b[0] >> off;
|
uint8_t byt = b[0] >> off;
|
||||||
uint8_t skip = 0;
|
uint8_t skip = 0;
|
||||||
@ -625,13 +624,11 @@ ur_bsr_log(ur_bsr_t *bsr, uint8_t *out)
|
|||||||
return _bsr_log_meme(bsr);
|
return _bsr_log_meme(bsr);
|
||||||
}
|
}
|
||||||
|
|
||||||
skip++;
|
byt = b[++skip];
|
||||||
|
|
||||||
if ( skip == left ) {
|
if ( skip == left ) {
|
||||||
return _bsr_set_gone(bsr, (skip << 3) - off);
|
return _bsr_set_gone(bsr, (skip << 3) - off);
|
||||||
}
|
}
|
||||||
|
|
||||||
byt = b[skip];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -646,10 +643,10 @@ ur_bsr_log(ur_bsr_t *bsr, uint8_t *out)
|
|||||||
|
|
||||||
left -= bytes;
|
left -= bytes;
|
||||||
|
|
||||||
bsr->bytes = left ? (b + bytes) : 0;
|
bsr->bytes = left ? (b + bytes) : 0;
|
||||||
bsr->bits += 1 + zeros;
|
bsr->bits += 1 + zeros;
|
||||||
bsr->left = left;
|
bsr->left = left;
|
||||||
bsr->off = ur_mask_3(bits);
|
bsr->off = ur_mask_3(bits);
|
||||||
|
|
||||||
*out = zeros;
|
*out = zeros;
|
||||||
return ur_cue_good;
|
return ur_cue_good;
|
||||||
|
Loading…
Reference in New Issue
Block a user