MCPcopy Index your code
hub / github.com/RustPython/RustPython / identical_optimization

Method identical_optimization

crates/vm/src/types/slot.rs:1914–1920  ·  view source on GitHub ↗
(
        self,
        a: &impl Borrow<PyObject>,
        b: &impl Borrow<PyObject>,
    )

Source from the content-addressed store, hash-verified

1912 /// appropriate return value exists.
1913 #[inline]
1914 pub fn identical_optimization(
1915 self,
1916 a: &impl Borrow<PyObject>,
1917 b: &impl Borrow<PyObject>,
1918 ) -> Option<bool> {
1919 self.map_eq(|| a.borrow().is(b.borrow()))
1920 }
1921
1922 /// Returns `Some(true)` when self is `Eq` and `f()` returns true. Returns `Some(false)` when self
1923 /// is `Ne` and `f()` returns true. Otherwise returns `None`.

Callers 8

cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80
cmpMethod · 0.80

Calls 3

map_eqMethod · 0.80
isMethod · 0.80
borrowMethod · 0.45

Tested by

no test coverage detected