mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
sort: tune diff_reversed
* src/sort.c (diff_reversed): Tune. On x86-64 with GCC, this saves a conditional branch and shortens the generated machine code.
This commit is contained in:
1 parent
dc457c5e1b
commit
9104dad18b
1 file changed
+1
-1
+1
-1
@@ -2607,7 +2607,7 @@ key_warnings (struct keyfield const *gkey, bool gkey_only)
|
||||
static int
|
||||
diff_reversed (int diff, bool reversed)
|
||||
{
|
||||
return reversed ? (diff < 0 ? 1 : -diff) : diff;
|
||||
return reversed ? (diff < 0) - (diff > 0) : diff;
|
||||
}
|
||||
|
||||
/* Compare two lines A and B trying every key in sequence until there
|
||||
|
||||
Reference in new issue
Block a user