diff --git a/ChangeLog b/ChangeLog index 37da3e4c93fc1f4d81e62cd43aabba0e8d9749a2..bcffb86c2d46bd3d5bc32ea74f5dd19f7f54e7c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ when they have the default cursor position (line 1, column 1). * src/files.c (write_file): Avoid a pointless lstat() when not writing to a temp file, and in the bargain elide two variables. + * src/files.c (write_file): Elide an unneeded 'if'. 2016-02-06 Benno Schulenberg <bensberg@justemail.net> * src/files.c (write_file): Remove the --nofollow option that hasn't diff --git a/src/files.c b/src/files.c index 65756976a407b7d60072233ec09ca55265fdcbd7..ae4f2be1a64b80ab87f7cd7c7a0a44ea6918b403 100644 --- a/src/files.c +++ b/src/files.c @@ -1765,7 +1765,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type /* The status fields filled in by stat(). */ char *realname; /* name after tilde expansion. */ - FILE *f = NULL; + FILE *f = f_open; /* The actual file, realname, we are writing to. */ char *tempname = NULL; /* The name of the temporary file we write to on prepend. */ @@ -1775,9 +1775,6 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type if (*name == '\0') return -1; - if (f_open != NULL) - f = f_open; - if (!tmp) titlebar(NULL);