diff options
author | dgp <dgp@users.sourceforge.net> | 2014-05-27 13:28:41 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-05-27 13:28:41 (GMT) |
commit | 88ab76b3b8d6f0bce701aa143b37d6167c885c9e (patch) | |
tree | 6e5c0491dd583fb852fe98ab933205c11f62a22b /generic/tclIO.c | |
parent | 5f8f27387d73b4da427fb6e29ddd143686a0bddc (diff) | |
download | tcl-88ab76b3b8d6f0bce701aa143b37d6167c885c9e.zip tcl-88ab76b3b8d6f0bce701aa143b37d6167c885c9e.tar.gz tcl-88ab76b3b8d6f0bce701aa143b37d6167c885c9e.tar.bz2 |
Move code that can only matter in the first loop iteration out of the loop.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 9e1a723..4e325ba 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -2510,12 +2510,6 @@ FlushChannel( return -1; } - /* - * Loop over the queued buffers and attempt to flush as much as possible - * of the queued output to the channel. - */ - - while (1) { /* * If the queue is empty and there is a ready current buffer, OR if * the current buffer is full, then move the current buffer to the @@ -2536,7 +2530,6 @@ FlushChannel( statePtr->outQueueTail = statePtr->curOutPtr; statePtr->curOutPtr = NULL; } - bufPtr = statePtr->outQueueHead; /* * If we are not being called from an async flush and an async flush @@ -2547,13 +2540,13 @@ FlushChannel( return 0; } - /* - * If the output queue is still empty, break out of the while loop. - */ + /* + * Loop over the queued buffers and attempt to flush as much as possible + * of the queued output to the channel. + */ - if (bufPtr == NULL) { - break; /* Out of the "while (1)". */ - } + while (statePtr->outQueueHead) { + bufPtr = statePtr->outQueueHead; /* * Produce the output on the channel. |