Optimize the test of non empty file