Use constants where possible
The hdr variable gets the same constants as value but it is easier to understand that the constants are used than the hdr which needs to be traced to the value it received.
This commit is contained in:
parent
a46581a35e
commit
24ec009d67
1 changed files with 2 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ int capn_deflate(struct capn_stream* s) {
|
||||||
if (s->avail_out < 2)
|
if (s->avail_out < 2)
|
||||||
return CAPN_NEED_MORE;
|
return CAPN_NEED_MORE;
|
||||||
|
|
||||||
s->next_out[0] = hdr;
|
s->next_out[0] = 0;
|
||||||
for (sz = 1; sz < min(s->avail_in/8, 256); sz++) {
|
for (sz = 1; sz < min(s->avail_in/8, 256); sz++) {
|
||||||
if (((uint64_t*) s->next_in)[sz] != 0) {
|
if (((uint64_t*) s->next_in)[sz] != 0) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -64,7 +64,7 @@ int capn_deflate(struct capn_stream* s) {
|
||||||
if (s->avail_out < 10)
|
if (s->avail_out < 10)
|
||||||
return CAPN_NEED_MORE;
|
return CAPN_NEED_MORE;
|
||||||
|
|
||||||
s->next_out[0] = hdr;
|
s->next_out[0] = 0xFF;
|
||||||
memcpy(s->next_out+1, s->next_in, 8);
|
memcpy(s->next_out+1, s->next_in, 8);
|
||||||
s->next_in += 8;
|
s->next_in += 8;
|
||||||
s->avail_in -= 8;
|
s->avail_in -= 8;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue