mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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 <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
841bdf3462
commit
0f3928f315
1 changed files with 1 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue