From 24ec009d671eac608b9ad67ea8d2b672d1e738c1 Mon Sep 17 00:00:00 2001 From: Baruch Even Date: Wed, 6 Aug 2014 07:26:05 +0300 Subject: [PATCH] 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. --- capn-stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capn-stream.c b/capn-stream.c index 2623835..7bf7205 100644 --- a/capn-stream.c +++ b/capn-stream.c @@ -46,7 +46,7 @@ int capn_deflate(struct capn_stream* s) { if (s->avail_out < 2) 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++) { if (((uint64_t*) s->next_in)[sz] != 0) { break; @@ -64,7 +64,7 @@ int capn_deflate(struct capn_stream* s) { if (s->avail_out < 10) return CAPN_NEED_MORE; - s->next_out[0] = hdr; + s->next_out[0] = 0xFF; memcpy(s->next_out+1, s->next_in, 8); s->next_in += 8; s->avail_in -= 8;