MCPcopy Create free account
hub / github.com/argumentcomputer/ix / eq_const

Function eq_const

crates/compile/src/compile.rs:2837–2846  ·  view source on GitHub ↗

Check if two mutual constants are structurally equal.

(
  x: &MutConst,
  y: &MutConst,
  mut_ctx: &MutCtx,
  cache: &mut BlockCache,
  stt: &CompileState,
)

Source from the content-addressed store, hash-verified

2835 },
2836 (LevelData::Zero(_), LevelData::Zero(_)) => Ok(SOrd::eq(true)),
2837 (LevelData::Zero(_), _) => Ok(SOrd::lt(true)),
2838 (_, LevelData::Zero(_)) => Ok(SOrd::gt(true)),
2839 (LevelData::Succ(x, _), LevelData::Succ(y, _)) => {
2840 compare_level(x, y, x_ctx, y_ctx)
2841 },
2842 (LevelData::Succ(_, _), _) => Ok(SOrd::lt(true)),
2843 (_, LevelData::Succ(_, _)) => Ok(SOrd::gt(true)),
2844 (LevelData::Max(xl, xr, _), LevelData::Max(yl, yr, _)) => {
2845 SOrd::try_compare(compare_level(xl, yl, x_ctx, y_ctx)?, || {
2846 compare_level(xr, yr, x_ctx, y_ctx)
2847 })
2848 },
2849 (LevelData::Max(_, _, _), _) => Ok(SOrd::lt(true)),

Callers 1

sort_constsFunction · 0.85

Calls 1

compare_constFunction · 0.85

Tested by

no test coverage detected