From e291b631c3b1aedf529078190cd51e2acfcd1d92 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 17 Aug 2015 12:40:53 +0200 Subject: [PATCH] common/iobuf.c:iobuf_write_temp: Elide redundant code. * common/iobuf.c (iobuf_write_temp): Don't repeat iobuf_flush_temp. Use it directly. -- Signed-off-by: Neal H. Walfield . --- common/iobuf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/iobuf.c b/common/iobuf.c index 4674fdf15..769926234 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -2114,11 +2114,13 @@ iobuf_writestr (iobuf_t a, const char *buf) int -iobuf_write_temp (iobuf_t a, iobuf_t temp) +iobuf_write_temp (iobuf_t dest, iobuf_t source) { - while (temp->chain) - pop_filter (temp, temp->filter, NULL); - return iobuf_write (a, temp->d.buf, temp->d.len); + assert (source->use == IOBUF_OUTPUT || source->use == IOBUF_TEMP); + assert (dest->use == IOBUF_OUTPUT || dest->use == IOBUF_TEMP); + + iobuf_flush_temp (source); + return iobuf_write (dest, source->d.buf, source->d.len); } size_t