Commit 782da86
authored
Rollup merge of #106798 - scottmcm:signum-via-cmp, r=Mark-Simulacrum
Implement `signum` with `Ord`
Rather than needing to do things like #105840 for `signum` too, might as well just implement that method using `Ord`, since it's doing the same "I need `-1`/`0`/`+1`" behaviour that `cmp` is already doing.
This also seems to slightly improve the assembly: <https://rust.godbolt.org/z/5oEEqbxK1>1 file changed
+6
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2574 | 2574 | | |
2575 | 2575 | | |
2576 | 2576 | | |
| 2577 | + | |
2577 | 2578 | | |
2578 | | - | |
2579 | | - | |
2580 | | - | |
2581 | | - | |
2582 | | - | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
2583 | 2584 | | |
2584 | 2585 | | |
2585 | 2586 | | |
| |||
0 commit comments