Skip to content
Tcl Source Code View Ticket
Login

View Ticket

unnecessary code in Tcl_SetMaxBlockTime

Closed / Fixede832d2b08fc9e1d1ec9c354806fcdd7e89de6c39Created 13 years agoUpdated 13 years ago
Descriptionplain2013-10-30 13:06:13
In generic/tclNotify.c, in the function Tcl_SetMaxBlockTime, checking for tsdPtr->blockTimeSet in the second if-clause is unnecessary. The current code looks as follows:

if (!tsdPtr->blockTimeSet || ...) {
    ...
    tsdPtr->blockTimeSet = 1;
}

if (!tsdPtr->inTraversal) {
    if (tsdPtr->blockTimeSet) {
        Tcl_SetTimer(&tsdPtr->blockTime);
    } else {
        Tcl_SetTimer(NULL);
    }
}

Either tsdPtr->blockTimeSet is already 1 when we enter this function, or otherwise the first if-clause will set it to 1. Therefore, the second if-clause can simply read

if (!tsdPtr->inTraversal) {
    Tcl_SetTimer(&tsdPtr->blockTime);
}
anonymous Ticket [e832d2b08f]: 3 changes [History diff]2013-10-30 13:07:00
jan.nijtmanswiki2013-11-16 21:09:08

Fixed in core-8-5-branch [4c14f88702] and trunk [04b08d7303]

Log in (anonymous is fine) to add a comment.