From f2d977aff104415832bcb6487943344d03f51450 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 3 Dec 2010 15:04:31 -0800 Subject: sort: simplify write_unique * src/sort.c (write_unique): Simplify slightly so that there is just one call to write_line, not two. --- src/sort.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/sort.c') diff --git a/src/sort.c b/src/sort.c index af4b20c3e..1faf1714d 100644 --- a/src/sort.c +++ b/src/sort.c @@ -3231,13 +3231,14 @@ write_unique (struct line const *line, FILE *tfp, char const *temp_output) { static struct line saved; - if (!unique) - write_line (line, tfp, temp_output); - else if (!saved.text || compare (line, &saved)) + if (unique) { + if (saved.text && ! compare (line, &saved)) + return; saved = *line; - write_line (line, tfp, temp_output); } + + write_line (line, tfp, temp_output); } /* Merge the lines currently available to a NODE in the binary -- cgit v1.2.3-54-g00ecf