mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Turn a while into a do/while; save a redundant test
svn:r6683
This commit is contained in:
parent
06e09cdd47
commit
b4b8da5d23
@ -1299,7 +1299,7 @@ write_to_buf_zlib(buf_t *buf, tor_zlib_state_t *state,
|
|||||||
char *next;
|
char *next;
|
||||||
size_t old_avail, avail;
|
size_t old_avail, avail;
|
||||||
int over = 0;
|
int over = 0;
|
||||||
while (!over) {
|
do {
|
||||||
buf_ensure_capacity(buf, buf->datalen + 1024);
|
buf_ensure_capacity(buf, buf->datalen + 1024);
|
||||||
next = _buf_end(buf);
|
next = _buf_end(buf);
|
||||||
if (next < buf->cur)
|
if (next < buf->cur)
|
||||||
@ -1339,7 +1339,7 @@ write_to_buf_zlib(buf_t *buf, tor_zlib_state_t *state,
|
|||||||
if (buf->datalen > buf->highwater)
|
if (buf->datalen > buf->highwater)
|
||||||
buf->highwater = buf->datalen;
|
buf->highwater = buf->datalen;
|
||||||
buf_total_used += old_avail - avail;
|
buf_total_used += old_avail - avail;
|
||||||
}
|
} while (!over);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user