Improve bufgetdata and bufread
commita871f584508d98767e3dd227062a3e7f1b8cc305
authorNicolas Pennequin <nicolas@nicolas-laptop.(none)>
Tue, 23 Oct 2007 16:54:25 +0000 (23 18:54 +0200)
committerlearman <learman@a1c6a512-1295-4272-9138-f99709370657>
Thu, 25 Oct 2007 19:18:20 +0000 (25 19:18 +0000)
tree002dd6ac7db177d61879f0fce5480cea3894aa37
parente9eac127ebb47642e1f2abb4925b9eac9a649463
Improve bufgetdata and bufread

First, "h->available - RINGBUF_SUB(h->ridx, h->data)" is actually equal to
"RINGBUF_SUB(h->widx, h->ridx)", to the condition we set h->widx properly
for all handles. It's easier to understand.

Second, only compute "RINGBUF_SUB(h->widx, h->ridx)" once and store the
result. This saves binsize (~350B)
apps/buffering.c