Please comment the reasoning here. The code you replaced sets all tickets to false if there was no dirty rect. In this case it's not immediately clear that "optimized" means the same as the original if, so a short comment would be helpfull.