Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2013-11-16
21:09 • Closed ticket [e832d2b08f]: unnecessary code in Tcl_SetMaxBlockTime plus 7 o... artifact: 3916336292 user: jan.nijtmans
21:06
Fix [e832d2b08]: unnecessary code in Tcl_SetMaxBlockTime. check-in: 04b08d7303 user: jan.nijtmans tags: trunk
21:05
Fix [e832d2b08]: unnecessary code in Tcl_SetMaxBlockTime. check-in: 4c14f88702 user: jan.nijtmans tags: core-8-5-branch
2013-10-30
13:07 • Ticket [e832d2b08f] unnecessary code in Tcl_SetMaxBlockTime status still Ope... artifact: 8b1de0fd1a user: anonymous
13:06 • New ticket [e832d2b08f]. artifact: 41c2b7acc0 user: anonymous

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.