From: Benno Schulenberg Date: Sun, 7 Feb 2016 13:08:27 +0000 (+0000) Subject: Eliding an unneeded 'if'. X-Git-Tag: v2.5.2~18 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=98a8c06394bb18acfd2cd15e11166b59dceff94a;p=nano.git Eliding an unneeded 'if'. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5617 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 37da3e4c..bcffb86c 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 * src/files.c (write_file): Remove the --nofollow option that hasn't diff --git a/src/files.c b/src/files.c index 65756976..ae4f2be1 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);