about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-06-11 18:05:33 +0200
committerGitHub <noreply@github.com>2022-06-11 18:05:33 +0200
commit39de4e4b6f24d5b93f84d702a3dd19b1db34d912 (patch)
treeece58091325081223e4d0b43136beb506ad06079
parent4b7ec84c3111b077431c693569ad137f0603e29c (diff)
parent9e1e4761862a875562a87631466e96a8c1ebab83 (diff)
downloadrust-39de4e4b6f24d5b93f84d702a3dd19b1db34d912.tar.gz
rust-39de4e4b6f24d5b93f84d702a3dd19b1db34d912.zip
Rollup merge of #97943 - Warrenren:master, r=Dylan-DPC
line 1352, change `self` to `*self`, other to `*other`

The current code will not results bug, but it difficult to understand. These code result to call &f32::partial_cmp(), and the performance will be lower than the changed code. I'm not sure why the current code don't use (*self) (*other), if you have some idea, please let me know.
-rw-r--r--library/core/src/cmp.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs
index f281e8429c6..81aed8afd5b 100644
--- a/library/core/src/cmp.rs
+++ b/library/core/src/cmp.rs
@@ -1349,7 +1349,7 @@ mod impls {
             impl PartialOrd for $t {
                 #[inline]
                 fn partial_cmp(&self, other: &$t) -> Option<Ordering> {
-                    match (self <= other, self >= other) {
+                    match (*self <= *other, *self >= *other) {
                         (false, false) => None,
                         (false, true) => Some(Greater),
                         (true, false) => Some(Less),