We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0faf404 commit 7396604Copy full SHA for 7396604
src/key.rs
@@ -673,13 +673,16 @@ impl<'de> serde::Deserialize<'de> for PublicKey {
673
674
impl PartialOrd for PublicKey {
675
fn partial_cmp(&self, other: &PublicKey) -> Option<core::cmp::Ordering> {
676
- self.serialize().partial_cmp(&other.serialize())
+ Some(self.cmp(other))
677
}
678
679
680
impl Ord for PublicKey {
681
fn cmp(&self, other: &PublicKey) -> core::cmp::Ordering {
682
- self.serialize().cmp(&other.serialize())
+ let ret = unsafe {
683
+ ffi::secp256k1_ec_pubkey_cmp(ffi::secp256k1_context_no_precomp, self.as_c_ptr(), other.as_c_ptr())
684
+ };
685
+ ret.cmp(&0i32)
686
687
688
0 commit comments