Skip to content

Commit

Permalink
Shadow config with rc
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Sep 8, 2024
1 parent 04ddb09 commit eda1c54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/reason.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,18 @@ fn step_configs(configs: ValidatedSteps) -> Option<Configs> {
let mut stepped = Configs::new();

for (instrs, config) in configs {
let config_rc = Rc::new(config);
let config = Rc::new(config);

for (next_state, next_color, shift) in instrs {
let mut next_tape = config_rc.tape.clone();
let mut next_tape = config.tape.clone();

next_tape.backstep(shift, next_color);

let mut next_config = Config {
state: next_state,
tape: next_tape,
prev: Some(Rc::clone(&config_rc)),
recs: config_rc.recs,
prev: Some(Rc::clone(&config)),
recs: config.recs,
};

if next_config.lin_rec() {
Expand Down

0 comments on commit eda1c54

Please sign in to comment.