sort: simplify write_unique

* src/sort.c (write_unique): Simplify slightly so that there is
just one call to write_line, not two.
This commit is contained in:
Paul Eggert committed 2010-12-03 23:43:31 -08:00
1 parent 6f4279421d
commit f2d977aff1
1 file changed
+5 -4
+5 -4
View File
@@ -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