From 4e40ec057eb3c8e81ca0a5f45f1773701529ff2a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 17 Oct 2019 11:23:22 +0200 Subject: [PATCH] tweaks: elide an unneeded check when making a backup When making a backup, we can be certain that the relevant file is not a temporary file, so 'stream' will necessarily be NULL. --- src/files.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/files.c b/src/files.c index d523e5d8..09bb833f 100644 --- a/src/files.c +++ b/src/files.c @@ -1570,7 +1570,6 @@ bool write_file(const char *name, FILE *stream, bool tmp, filetime[0].tv_sec = openfile->current_stat->st_atime; filetime[1].tv_sec = openfile->current_stat->st_mtime; - if (stream == NULL) { /* Open the original file to copy to the backup. */ f = fopen(realname, "rb"); @@ -1582,7 +1581,6 @@ bool write_file(const char *name, FILE *stream, bool tmp, * nothing. */ goto skip_backup; } - } /* If backup_dir is set, we set backupname to * backup_dir/backupname~[.number], where backupname is the