MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / sort_lt

Method sort_lt

compiler/src/modules/vm/builtins/sequence.rs:165–170  ·  view source on GitHub ↗

a < b via __lt__ when either side defines it, else the built-in comparison.

(&mut self, a: Val, b: Val, chunk: &SSAChunk, slots: &mut [Val])

Source from the content-addressed store, hash-verified

163
164 // a < b via __lt__ when either side defines it, else the built-in comparison.
165 pub(crate) fn sort_lt(&mut self, a: Val, b: Val, chunk: &SSAChunk, slots: &mut [Val]) -> Result<bool, VmErr> {
166 if let Some(r) = self.try_compare_dunder(OpCode::Lt, a, b, chunk, slots)? {
167 return Ok(self.truthy(r));
168 }
169 self.lt_vals(a, b)
170 }
171
172 /* In-place sort dispatching `__lt__`; roots items since a comparison can run user code that GCs. */
173 pub(crate) fn sort_by_lt(&mut self, items: &mut [Val], chunk: &SSAChunk, slots: &mut [Val]) -> Result<(), VmErr> {

Callers 2

sort_by_keyMethod · 0.80
sort_by_ltMethod · 0.80

Calls 3

try_compare_dunderMethod · 0.80
truthyMethod · 0.80
lt_valsMethod · 0.80

Tested by

no test coverage detected