remove need to clone instructions.
This commit is contained in:
@@ -3,7 +3,6 @@ use prolog_parser::ast::*;
|
||||
use prolog::instructions::*;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::hash::Hash;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum IntIndex {
|
||||
@@ -141,7 +140,7 @@ impl CodeOffsets {
|
||||
|
||||
if con_ind.len() > 1 {
|
||||
let index = Self::flatten_index(con_ind, prelude.len());
|
||||
let instr = IndexingInstruction::SwitchOnConstant(index.len(), Rc::new(index));
|
||||
let instr = IndexingInstruction::SwitchOnConstant(index.len(), index);
|
||||
|
||||
prelude.push_front(Line::from(instr));
|
||||
|
||||
@@ -161,7 +160,7 @@ impl CodeOffsets {
|
||||
|
||||
if str_ind.len() > 1 {
|
||||
let index = Self::flatten_index(str_ind, prelude.len());
|
||||
let instr = IndexingInstruction::SwitchOnStructure(index.len(), Rc::new(index));
|
||||
let instr = IndexingInstruction::SwitchOnStructure(index.len(), index);
|
||||
|
||||
prelude.push_front(Line::from(instr));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user