use slightly better names in indexing functions

This commit is contained in:
Mark Thom
2020-04-30 18:20:42 -06:00
parent b6df5a4b7f
commit efd5d6efab
3 changed files with 5 additions and 5 deletions

View File

@@ -238,7 +238,7 @@ impl Addr {
}
}
pub fn as_constant(&self, machine_st: &MachineState) -> Option<Constant> {
pub fn as_constant_index(&self, machine_st: &MachineState) -> Option<Constant> {
match self {
&Addr::Char(c) => {
Some(Constant::Char(c))
@@ -249,7 +249,7 @@ impl Addr {
&Addr::Con(h) => {
match &machine_st.heap[h] {
&HeapCellValue::Atom(ref name, ref op) => {
Some(Constant::Atom(name.clone(), op.clone()))
Some(Constant::Atom(name.clone(), None))
}
&HeapCellValue::Integer(ref n) => {
Some(Constant::Integer(n.clone()))

View File

@@ -1433,7 +1433,7 @@ impl MachineState {
let addr = self.store(self.deref(addr));
let offset =
match addr.as_constant(&self) {
match addr.as_constant_index(&self) {
Some(c) => {
match hm.get(&c) {
Some(offset) => *offset,