Moreover, it may be better to have the boolean tested directly, rather than its negation. It won't have much effect on performances but the code will be easier to read :-)