From 0f3928f315d147e0631e7ca2c6c928847425a273 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Dec 2013 17:56:35 -0800 Subject: Don't check if a file exists right before trying to open it The open call will tell us what we need to know. Obviously we can't open a file that doesn't exist. This saves us one stat() or Windows equivalent. Signed-off-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- qt-ui/subsurfacewebservices.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 7828b4012..b6d9261c9 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -559,8 +559,7 @@ void DivelogsDeWebServices::prepareDivesForUpload() char *filename = prepare_dives_for_divelogs(true); if (filename) { QFile f(filename); - if (f.exists()) { - f.open(QIODevice::ReadOnly); + if (f.open(QIODevice::ReadOnly)) { uploadDives((QIODevice *)&f); f.close(); f.remove(); -- cgit v1.2.3-70-g09d2