mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
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:
1 parent
6f4279421d
commit
f2d977aff1
1 file changed
+5
-4
+5
-4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user