summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-07-03 13:32:19 (GMT)
committersebres <sebres@users.sourceforge.net>2017-07-03 13:32:19 (GMT)
commit0a588d204138059ddc43ebceb74de18ccf9c7836 (patch)
tree145370ee58786d5efc7ff1198b5b443d028a9025 /generic
parent0e4432a80db28d9dd87ba13040ea37b69b78733c (diff)
downloadtcl-0a588d204138059ddc43ebceb74de18ccf9c7836.zip
tcl-0a588d204138059ddc43ebceb74de18ccf9c7836.tar.gz
tcl-0a588d204138059ddc43ebceb74de18ccf9c7836.tar.bz2
code review and small optimizations
Diffstat (limited to 'generic')
-rw-r--r--generic/tclNotify.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/generic/tclNotify.c b/generic/tclNotify.c
index b16dea7..0dd55c4 100644
--- a/generic/tclNotify.c
+++ b/generic/tclNotify.c
@@ -726,17 +726,18 @@ Tcl_ServiceEvent(
}
}
+ /* Fast bypass case */
+ if ( !tsdPtr->firstEventPtr /* no other events */
+ || ((flags & TCL_ALL_EVENTS) == TCL_TIMER_EVENTS) /* timers only */
+ ) {
+ goto timer;
+ }
+
/*
* If timer marker reached, process timer events now.
*/
- if (flags & TCL_TIMER_EVENTS) { /* timer allowed */
- if ( tsdPtr->timerMarkerPtr == INT2PTR(-1) /* timer-event reached */
- || ( tsdPtr->timerMarkerPtr == INT2PTR(-2) /* next cycle, but ... */
- && ((flags & TCL_ALL_EVENTS) == TCL_TIMER_EVENTS) /* timers only */
- )
- ) {
- goto processTimer;
- }
+ if ((flags & TCL_TIMER_EVENTS) && (tsdPtr->timerMarkerPtr == INT2PTR(-1))) {
+ goto processTimer;
}
/*
@@ -845,6 +846,7 @@ Tcl_ServiceEvent(
}
Tcl_MutexUnlock(&(tsdPtr->queueMutex));
+ timer:
/*
* Process timer queue, if alloved and timers are enabled.
*/