summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2014-05-27 13:28:41 (GMT)
committerdgp@users.sourceforge.net <dgp>2014-05-27 13:28:41 (GMT)
commit12c2234b05132eaf1a7ae44832a1b4bd7c896ffb (patch)
tree6e5c0491dd583fb852fe98ab933205c11f62a22b /generic/tclIO.c
parent3e10c7a41cca97d595af1c1e4950752d1178bf21 (diff)
downloadtcl-12c2234b05132eaf1a7ae44832a1b4bd7c896ffb.zip
tcl-12c2234b05132eaf1a7ae44832a1b4bd7c896ffb.tar.gz
tcl-12c2234b05132eaf1a7ae44832a1b4bd7c896ffb.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.c19
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.