fn cmp_atoms(a: LTerm, b: LTerm) -> Ordering {
  assert!(!a.is_nil());
  let atomp_a = atom::lookup(a);
  debug_assert!(!atomp_a.is_null(),
                "cmp_atoms: atom lookup {} failed", a);

  assert!(!b.is_nil());
  let atomp_b = atom::lookup(b);
  debug_assert!(!atomp_b.is_null(),
                "cmp_atoms: atom lookup {} failed", b);

  // This should really be safe, as pointers to Atom exist statically forever
  unsafe {
    let a_len = (*atomp_a).len;
    let b_len = (*atomp_b).len;
    if a_len == b_len {
      return (*atomp_a).name.cmp(&(*atomp_b).name);
    }
    a_len.cmp(&b_len)
  }
}
/// Compare two atoms for equality.
Compare two atoms for equality.
Compare two atoms for equality .
fn cmp_atoms(a: LTerm, b: LTerm) -> Ordering {
  assert!(!a.is_nil());
  let atomp_a = atom::lookup(a);
  debug_assert!(!atomp_a.is_null(),
                "cmp_atoms: atom lookup {} failed", a);
  assert!(!b.is_nil());
  let atomp_b = atom::lookup(b);
  debug_assert!(!atomp_b.is_null(),
                "cmp_atoms: atom lookup {} failed", b);
  // This should really be safe, as pointers to Atom exist statically forever
  unsafe {
    let a_len = (*atomp_a).len;
    let b_len = (*atomp_b).len;
    if a_len == b_len {
      return (*atomp_a).name.cmp(&(*atomp_b).name);
    }
    a_len.cmp(&b_len)
  }
}
fn cmp_atoms ( a : LTerm , b : LTerm ) -> Ordering { assert ! ( a is_nil ( ) ) ; let atomp_a = atom :: lookup ( a ) ; debug_assert ! ( atomp_a is_null ( ) " " a ) ; assert ! ( b is_nil ( ) ) ; let atomp_b = atom :: lookup ( b ) ; debug_assert ! ( atomp_b is_null ( ) " " b ) ; // This should really be safe, as pointers to Atom exist statically forever unsafe { let a_len = ( * atomp_a ) . len ; let b_len = ( * atomp_b ) . len ; if a_len == b_len { return ( * atomp_a ) . name . cmp ( & ( * atomp_b ) . name ) ; } a_len . cmp ( & b_len ) } }
Compare two atoms for equality.
Compare two atoms for equality .
a
LTerm
b
LTerm